Upload files to ".suckless/patch"
This commit is contained in:
parent
a4f72ccb0e
commit
ed373fd5c1
5 changed files with 244 additions and 0 deletions
BIN
.suckless/patch/dwm-alpha-20230401-348f655.diff
Normal file
BIN
.suckless/patch/dwm-alpha-20230401-348f655.diff
Normal file
Binary file not shown.
130
.suckless/patch/dwmc
Normal file
130
.suckless/patch/dwmc
Normal file
|
@ -0,0 +1,130 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
signal() {
|
||||||
|
xsetroot -name "fsignal:$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
case $# in
|
||||||
|
1)
|
||||||
|
case $1 in
|
||||||
|
focusurgent) ;&
|
||||||
|
mirrorlayout) ;&
|
||||||
|
mpdcontrol) ;&
|
||||||
|
pushdown) ;&
|
||||||
|
pushup) ;&
|
||||||
|
self_restart) ;&
|
||||||
|
setlayout) ;&
|
||||||
|
setcfact) ;&
|
||||||
|
switchcol) ;&
|
||||||
|
view) ;&
|
||||||
|
viewall) ;&
|
||||||
|
viewtoleft) ;&
|
||||||
|
viewtoright) ;&
|
||||||
|
tagtoleft) ;&
|
||||||
|
tagtoright) ;&
|
||||||
|
tagandviewtoleft) ;&
|
||||||
|
tagandviewtoright) ;&
|
||||||
|
transfer) ;&
|
||||||
|
transferall) ;&
|
||||||
|
togglealttag) ;&
|
||||||
|
togglebar) ;&
|
||||||
|
togglefloating) ;&
|
||||||
|
togglefullscreen) ;&
|
||||||
|
fullscreen) ;&
|
||||||
|
togglefakefullscreen) ;&
|
||||||
|
togglesticky) ;&
|
||||||
|
togglehorizontalmax) ;&
|
||||||
|
toggleverticalmax) ;&
|
||||||
|
togglemax) ;&
|
||||||
|
togglegaps) ;&
|
||||||
|
defaultgaps) ;&
|
||||||
|
unfloatvisible) ;&
|
||||||
|
winview) ;&
|
||||||
|
xrdb) ;&
|
||||||
|
zoom) ;&
|
||||||
|
killclient) ;&
|
||||||
|
quit)
|
||||||
|
signal $1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown command ($1) or missing one argument."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
case $1 in
|
||||||
|
cyclelayout) ;&
|
||||||
|
explace) ;&
|
||||||
|
moveplace) ;&
|
||||||
|
mpdchange) ;&
|
||||||
|
setkeymode) ;&
|
||||||
|
switchtag) ;&
|
||||||
|
togglescratch) ;&
|
||||||
|
view)
|
||||||
|
signal $1 ui $2
|
||||||
|
;;
|
||||||
|
viewex) ;&
|
||||||
|
toggleviewex) ;&
|
||||||
|
tagallmon) ;&
|
||||||
|
tagswapmon) ;&
|
||||||
|
tagex) ;&
|
||||||
|
toggletagex) ;&
|
||||||
|
setborderpx) ;&
|
||||||
|
setgaps) ;&
|
||||||
|
setlayoutex) ;&
|
||||||
|
setlayoutaxisex) ;&
|
||||||
|
swapfocus) ;&
|
||||||
|
focusstack) ;&
|
||||||
|
pushstack) ;&
|
||||||
|
inplacerotate) ;&
|
||||||
|
rotatestack) ;&
|
||||||
|
rotatelayoutaxis) ;&
|
||||||
|
incnmaster) ;&
|
||||||
|
incnstack) ;&
|
||||||
|
incrgaps) ;&
|
||||||
|
incrigaps) ;&
|
||||||
|
incrogaps) ;&
|
||||||
|
incrihgaps) ;&
|
||||||
|
incrivgaps) ;&
|
||||||
|
incrohgaps) ;&
|
||||||
|
incrovgaps) ;&
|
||||||
|
movestack) ;&
|
||||||
|
shiftview) ;&
|
||||||
|
shiftviewclients) ;&
|
||||||
|
focusmon) ;&
|
||||||
|
tagmon)
|
||||||
|
signal $1 i $2
|
||||||
|
;;
|
||||||
|
setcfact) ;&
|
||||||
|
setmfact)
|
||||||
|
signal $1 f $2
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown command ($1) or too many arguments"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
5)
|
||||||
|
case $1 in
|
||||||
|
setgaps)
|
||||||
|
# Expects "setgaps oh ov ih iv" where -1 means to keep existing values
|
||||||
|
[ $2 = -1 ] && oh=128 || oh=$2
|
||||||
|
[ $3 = -1 ] && ov=128 || ov=$3
|
||||||
|
[ $4 = -1 ] && ih=128 || ih=$4
|
||||||
|
[ $5 = -1 ] && iv=128 || iv=$5
|
||||||
|
signal $1 i $(((oh << 24) + (ov << 16) + (ih << 8) + iv))
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown command ($1) or too many arguments"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown command ($1) or too many arguments"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
85
.suckless/patch/dwmc.c
Normal file
85
.suckless/patch/dwmc.c
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
void
|
||||||
|
setlayoutex(const Arg *arg)
|
||||||
|
{
|
||||||
|
setlayout(&((Arg) { .v = &layouts[arg->i] }));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
viewex(const Arg *arg)
|
||||||
|
{
|
||||||
|
view(&((Arg) { .ui = 1 << arg->ui }));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
viewallex(const Arg *arg)
|
||||||
|
{
|
||||||
|
view(&((Arg){.ui = ~SPTAGMASK}));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
toggleviewex(const Arg *arg)
|
||||||
|
{
|
||||||
|
toggleview(&((Arg) { .ui = 1 << arg->ui }));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
tagex(const Arg *arg)
|
||||||
|
{
|
||||||
|
tag(&((Arg) { .ui = 1 << arg->ui }));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
toggletagex(const Arg *arg)
|
||||||
|
{
|
||||||
|
toggletag(&((Arg) { .ui = 1 << arg->ui }));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
tagallex(const Arg *arg)
|
||||||
|
{
|
||||||
|
tag(&((Arg){.ui = ~SPTAGMASK}));
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
fake_signal(void)
|
||||||
|
{
|
||||||
|
char fsignal[256];
|
||||||
|
char indicator[9] = "fsignal:";
|
||||||
|
char str_sig[50];
|
||||||
|
char param[16];
|
||||||
|
int i, len_str_sig, n, paramn;
|
||||||
|
size_t len_fsignal, len_indicator = strlen(indicator);
|
||||||
|
Arg arg;
|
||||||
|
|
||||||
|
// Get root name property
|
||||||
|
if (gettextprop(root, XA_WM_NAME, fsignal, sizeof(fsignal))) {
|
||||||
|
len_fsignal = strlen(fsignal);
|
||||||
|
|
||||||
|
// Check if this is indeed a fake signal
|
||||||
|
if (len_indicator > len_fsignal ? 0 : strncmp(indicator, fsignal, len_indicator) == 0) {
|
||||||
|
paramn = sscanf(fsignal+len_indicator, "%s%n%s%n", str_sig, &len_str_sig, param, &n);
|
||||||
|
|
||||||
|
if (paramn == 1) arg = (Arg) {0};
|
||||||
|
else if (paramn > 2) return 1;
|
||||||
|
else if (strncmp(param, "i", n - len_str_sig) == 0)
|
||||||
|
sscanf(fsignal + len_indicator + n, "%i", &(arg.i));
|
||||||
|
else if (strncmp(param, "ui", n - len_str_sig) == 0)
|
||||||
|
sscanf(fsignal + len_indicator + n, "%u", &(arg.ui));
|
||||||
|
else if (strncmp(param, "f", n - len_str_sig) == 0)
|
||||||
|
sscanf(fsignal + len_indicator + n, "%f", &(arg.f));
|
||||||
|
else return 1;
|
||||||
|
|
||||||
|
// Check if a signal was found, and if so handle it
|
||||||
|
for (i = 0; i < LENGTH(signals); i++)
|
||||||
|
if (strncmp(str_sig, signals[i].sig, len_str_sig) == 0 && signals[i].func)
|
||||||
|
signals[i].func(&(arg));
|
||||||
|
|
||||||
|
// A fake signal was sent
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// No fake signal was sent, so proceed with update
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
14
.suckless/patch/dwmc.h
Normal file
14
.suckless/patch/dwmc.h
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
typedef struct {
|
||||||
|
const char * sig;
|
||||||
|
void (*func)(const Arg *);
|
||||||
|
} Signal;
|
||||||
|
|
||||||
|
static void setlayoutex(const Arg *arg);
|
||||||
|
static void viewex(const Arg *arg);
|
||||||
|
static void viewallex(const Arg *arg);
|
||||||
|
static void toggleviewex(const Arg *arg);
|
||||||
|
static void tagex(const Arg *arg);
|
||||||
|
static void toggletagex(const Arg *arg);
|
||||||
|
static void tagallex(const Arg *arg);
|
||||||
|
static int fake_signal(void);
|
||||||
|
|
15
.suckless/patch/fullscreen.c
Normal file
15
.suckless/patch/fullscreen.c
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
Layout *last_layout;
|
||||||
|
|
||||||
|
void
|
||||||
|
fullscreen(const Arg *arg)
|
||||||
|
{
|
||||||
|
int monocle_pos = 0;
|
||||||
|
if (selmon->showbar || last_layout == NULL) {
|
||||||
|
for (last_layout = (Layout *)layouts; last_layout != selmon->lt[selmon->sellt]; last_layout++);
|
||||||
|
setlayout(&((Arg) { .v = &layouts[monocle_pos] }));
|
||||||
|
} else {
|
||||||
|
setlayout(&((Arg) { .v = last_layout }));
|
||||||
|
}
|
||||||
|
togglebar(arg);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue