mirror of
https://github.com/CoolnsX/repos_scripts.git
synced 2025-12-20 15:25:20 +05:30
lol
This commit is contained in:
4
ani-new
4
ani-new
@@ -40,8 +40,8 @@ notify-send "Fetching doodstream links" -r $tmp
|
|||||||
dood_id=$(printf "$links" | sed -n "s_.*dood.*/e/__p")
|
dood_id=$(printf "$links" | sed -n "s_.*dood.*/e/__p")
|
||||||
[ -z "$dood_id" ] || dood_link=$(curl -A "$agent" -s "https://dood.wf/d/$dood_id" | sed -nE 's/<a href="(.*)" class="btn.*justify.*/\1/p')
|
[ -z "$dood_id" ] || dood_link=$(curl -A "$agent" -s "https://dood.wf/d/$dood_id" | sed -nE 's/<a href="(.*)" class="btn.*justify.*/\1/p')
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
[ -z "$dood_link" ] || dood_video=$(curl -A "$agent" -s "https://dood.wf${dood_link}" | sed -nE "s/.*window.open.*'(.*)',.*/\1/p")
|
[ -z "$dood_link" ] || dood_video=$(curl -A "$agent" -s "https://dood.ws${dood_link}" | sed -nE "s/.*window.open.*'(.*)',.*/\1/p")
|
||||||
[ -z "$dood_video" ] || down "https://dood.wf/d/$dood_id" "$dood_video" "doodstream"
|
[ -z "$dood_video" ] || down "https://dood.ws/d/$dood_id" "$dood_video" "doodstream"
|
||||||
|
|
||||||
notify-send "Fetching xstreamcdn links" -r $tmp
|
notify-send "Fetching xstreamcdn links" -r $tmp
|
||||||
fb_id=$(printf "$links" | sed -n "s_.*fembed.*/v/__p")
|
fb_id=$(printf "$links" | sed -n "s_.*fembed.*/v/__p")
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
/* See LICENSE file for copyright and license details. */
|
|
||||||
/* Default settings; can be overriden by command line. */
|
|
||||||
|
|
||||||
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
|
|
||||||
static int centered = 1; /* -c option; centers dmenu on screen */
|
|
||||||
static int min_width = 500; /* minimum width when centered */
|
|
||||||
/* -fn option overrides fonts[0]; default X11 font or font set */
|
|
||||||
static const char *fonts[] = {
|
|
||||||
"Roboto:size=13"
|
|
||||||
};
|
|
||||||
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
|
|
||||||
static const char *colors[SchemeLast][2] = {
|
|
||||||
/* fg bg */
|
|
||||||
[SchemeNorm] = { "#bbbbbb", "#222222" },
|
|
||||||
[SchemeSel] = { "#eeeeee", "#8800aa" },
|
|
||||||
[SchemeOut] = { "#000000", "#00ffff" },
|
|
||||||
};
|
|
||||||
/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
|
|
||||||
static unsigned int lines = 10;
|
|
||||||
/* -h option; minimum height of a menu line */
|
|
||||||
static unsigned int lineheight = 0;
|
|
||||||
static unsigned int min_lineheight = 8;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Characters not considered part of a word while deleting words
|
|
||||||
* for example: " /?\"&[]"
|
|
||||||
*/
|
|
||||||
static const char worddelimiters[] = " ";
|
|
||||||
|
|
||||||
/* Size of the window border */
|
|
||||||
static const unsigned int border_width = 4;
|
|
||||||
BIN
dmenu-5.1/dmenu
BIN
dmenu-5.1/dmenu
Binary file not shown.
@@ -3,7 +3,7 @@
|
|||||||
dmenu \- dynamic menu
|
dmenu \- dynamic menu
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B dmenu
|
.B dmenu
|
||||||
.RB [ \-bfiv ]
|
.RB [ \-bfsv ]
|
||||||
.RB [ \-l
|
.RB [ \-l
|
||||||
.IR lines ]
|
.IR lines ]
|
||||||
.RB [ \-h
|
.RB [ \-h
|
||||||
@@ -49,8 +49,8 @@ dmenu appears centered on the screen.
|
|||||||
dmenu grabs the keyboard before reading stdin if not reading from a tty. This
|
dmenu grabs the keyboard before reading stdin if not reading from a tty. This
|
||||||
is faster, but will lock up X until stdin reaches end\-of\-file.
|
is faster, but will lock up X until stdin reaches end\-of\-file.
|
||||||
.TP
|
.TP
|
||||||
.B \-i
|
.B \-s
|
||||||
dmenu matches menu items case insensitively.
|
dmenu matches menu items case sensitively.
|
||||||
.TP
|
.TP
|
||||||
.BI \-l " lines"
|
.BI \-l " lines"
|
||||||
dmenu lists items vertically, with the given number of lines.
|
dmenu lists items vertically, with the given number of lines.
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ dmenu \- dynamic menu
|
|||||||
.RB [ \-bfiv ]
|
.RB [ \-bfiv ]
|
||||||
.RB [ \-l
|
.RB [ \-l
|
||||||
.IR lines ]
|
.IR lines ]
|
||||||
|
.RB [ \-h
|
||||||
|
.IR height ]
|
||||||
.RB [ \-m
|
.RB [ \-m
|
||||||
.IR monitor ]
|
.IR monitor ]
|
||||||
.RB [ \-p
|
.RB [ \-p
|
||||||
@@ -53,6 +55,9 @@ dmenu matches menu items case insensitively.
|
|||||||
.BI \-l " lines"
|
.BI \-l " lines"
|
||||||
dmenu lists items vertically, with the given number of lines.
|
dmenu lists items vertically, with the given number of lines.
|
||||||
.TP
|
.TP
|
||||||
|
.BI \-h " height"
|
||||||
|
dmenu uses a menu line of at least 'height' pixels tall, but no less than 8.
|
||||||
|
.TP
|
||||||
.BI \-m " monitor"
|
.BI \-m " monitor"
|
||||||
dmenu is displayed on the monitor number supplied. Monitor numbers are starting
|
dmenu is displayed on the monitor number supplied. Monitor numbers are starting
|
||||||
from 0.
|
from 0.
|
||||||
|
|||||||
@@ -55,8 +55,9 @@ static Clr *scheme[SchemeLast];
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
static int (*fstrncmp)(const char *, const char *, size_t) = strncmp;
|
static char * cistrstr(const char *s, const char *sub);
|
||||||
static char *(*fstrstr)(const char *, const char *) = strstr;
|
static int (*fstrncmp)(const char *, const char *, size_t) = strncasecmp;
|
||||||
|
static char *(*fstrstr)(const char *, const char *) = cistrstr;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
appenditem(struct item *item, struct item **list, struct item **last)
|
appenditem(struct item *item, struct item **list, struct item **last)
|
||||||
@@ -870,9 +871,9 @@ main(int argc, char *argv[])
|
|||||||
fast = 1;
|
fast = 1;
|
||||||
else if (!strcmp(argv[i], "-c")) /* centers dmenu on screen */
|
else if (!strcmp(argv[i], "-c")) /* centers dmenu on screen */
|
||||||
centered = 1;
|
centered = 1;
|
||||||
else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
|
else if (!strcmp(argv[i], "-s")) { /* case-sensitive item matching */
|
||||||
fstrncmp = strncasecmp;
|
fstrncmp = strncmp;
|
||||||
fstrstr = cistrstr;
|
fstrstr = strstr;
|
||||||
} else if (i + 1 == argc)
|
} else if (i + 1 == argc)
|
||||||
usage();
|
usage();
|
||||||
/* these options take one argument */
|
/* these options take one argument */
|
||||||
|
|||||||
@@ -527,6 +527,119 @@ draw:
|
|||||||
drawmenu();
|
drawmenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
buttonpress(XEvent *e)
|
||||||
|
{
|
||||||
|
struct item *item;
|
||||||
|
XButtonPressedEvent *ev = &e->xbutton;
|
||||||
|
int x = 0, y = 0, h = bh, w;
|
||||||
|
|
||||||
|
if (ev->window != win)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* right-click: exit */
|
||||||
|
if (ev->button == Button3)
|
||||||
|
exit(1);
|
||||||
|
|
||||||
|
if (prompt && *prompt)
|
||||||
|
x += promptw;
|
||||||
|
|
||||||
|
/* input field */
|
||||||
|
w = (lines > 0 || !matches) ? mw - x : inputw;
|
||||||
|
|
||||||
|
/* left-click on input: clear input,
|
||||||
|
* NOTE: if there is no left-arrow the space for < is reserved so
|
||||||
|
* add that to the input width */
|
||||||
|
if (ev->button == Button1 &&
|
||||||
|
((lines <= 0 && ev->x >= 0 && ev->x <= x + w +
|
||||||
|
((!prev || !curr->left) ? TEXTW("<") : 0)) ||
|
||||||
|
(lines > 0 && ev->y >= y && ev->y <= y + h))) {
|
||||||
|
insert(NULL, -cursor);
|
||||||
|
drawmenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* middle-mouse click: paste selection */
|
||||||
|
if (ev->button == Button2) {
|
||||||
|
XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY,
|
||||||
|
utf8, utf8, win, CurrentTime);
|
||||||
|
drawmenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* scroll up */
|
||||||
|
if (ev->button == Button4 && prev) {
|
||||||
|
sel = curr = prev;
|
||||||
|
calcoffsets();
|
||||||
|
drawmenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* scroll down */
|
||||||
|
if (ev->button == Button5 && next) {
|
||||||
|
sel = curr = next;
|
||||||
|
calcoffsets();
|
||||||
|
drawmenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (ev->button != Button1)
|
||||||
|
return;
|
||||||
|
if (ev->state & ~ControlMask)
|
||||||
|
return;
|
||||||
|
if (lines > 0) {
|
||||||
|
/* vertical list: (ctrl)left-click on item */
|
||||||
|
w = mw - x;
|
||||||
|
for (item = curr; item != next; item = item->right) {
|
||||||
|
y += h;
|
||||||
|
if (ev->y >= y && ev->y <= (y + h)) {
|
||||||
|
puts(item->text);
|
||||||
|
if (!(ev->state & ControlMask))
|
||||||
|
exit(0);
|
||||||
|
sel = item;
|
||||||
|
if (sel) {
|
||||||
|
sel->out = 1;
|
||||||
|
drawmenu();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (matches) {
|
||||||
|
/* left-click on left arrow */
|
||||||
|
x += inputw;
|
||||||
|
w = TEXTW("<");
|
||||||
|
if (prev && curr->left) {
|
||||||
|
if (ev->x >= x && ev->x <= x + w) {
|
||||||
|
sel = curr = prev;
|
||||||
|
calcoffsets();
|
||||||
|
drawmenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* horizontal list: (ctrl)left-click on item */
|
||||||
|
for (item = curr; item != next; item = item->right) {
|
||||||
|
x += w;
|
||||||
|
w = MIN(TEXTW(item->text), mw - x - TEXTW(">"));
|
||||||
|
if (ev->x >= x && ev->x <= x + w) {
|
||||||
|
puts(item->text);
|
||||||
|
if (!(ev->state & ControlMask))
|
||||||
|
exit(0);
|
||||||
|
sel = item;
|
||||||
|
if (sel) {
|
||||||
|
sel->out = 1;
|
||||||
|
drawmenu();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* left-click on right arrow */
|
||||||
|
w = TEXTW(">");
|
||||||
|
x = mw - w;
|
||||||
|
if (next && ev->x >= x && ev->x <= x + w) {
|
||||||
|
sel = curr = next;
|
||||||
|
calcoffsets();
|
||||||
|
drawmenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
paste(void)
|
paste(void)
|
||||||
{
|
{
|
||||||
@@ -588,6 +701,9 @@ run(void)
|
|||||||
break;
|
break;
|
||||||
cleanup();
|
cleanup();
|
||||||
exit(1);
|
exit(1);
|
||||||
|
case ButtonPress:
|
||||||
|
buttonpress(&ev);
|
||||||
|
break;
|
||||||
case Expose:
|
case Expose:
|
||||||
if (ev.xexpose.count == 0)
|
if (ev.xexpose.count == 0)
|
||||||
drw_map(drw, win, 0, 0, mw, mh);
|
drw_map(drw, win, 0, 0, mw, mh);
|
||||||
@@ -700,7 +816,7 @@ setup(void)
|
|||||||
/* create menu window */
|
/* create menu window */
|
||||||
swa.override_redirect = True;
|
swa.override_redirect = True;
|
||||||
swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
|
swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
|
||||||
swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
|
swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask | ButtonPressMask;
|
||||||
win = XCreateWindow(dpy, parentwin, x, y, mw, mh, border_width,
|
win = XCreateWindow(dpy, parentwin, x, y, mw, mh, border_width,
|
||||||
CopyFromParent, CopyFromParent, CopyFromParent,
|
CopyFromParent, CopyFromParent, CopyFromParent,
|
||||||
CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
|
CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
|
||||||
|
|||||||
Binary file not shown.
@@ -4,6 +4,7 @@
|
|||||||
- [center](https://tools.suckless.org/dmenu/patches/center/)
|
- [center](https://tools.suckless.org/dmenu/patches/center/)
|
||||||
- [line-height](https://tools.suckless.org/dmenu/patches/line-height/)
|
- [line-height](https://tools.suckless.org/dmenu/patches/line-height/)
|
||||||
- [mouse-support](https://tools.suckless.org/dmenu/patches/mouse-support/)
|
- [mouse-support](https://tools.suckless.org/dmenu/patches/mouse-support/)
|
||||||
|
- [case-insensitive](https://tools.suckless.org/dmenu/patches/case-insensitive/)
|
||||||
|
|
||||||
## St 0.8.5 with Applied Patches
|
## St 0.8.5 with Applied Patches
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user