diff options
| author | ProsperousPotato <ProsperousPotato@users.noreply.github.com> | 2024-12-07 14:33:12 +0000 |
|---|---|---|
| committer | ProsperousPotato <ProsperousPotato@users.noreply.github.com> | 2025-03-31 18:31:28 +0100 |
| commit | 2acec1e83ca3c3a0b2ade0b11ba48873afcf7341 (patch) | |
| tree | e41c4e39b323f43228d74189a9784995bb3be7d8 | |
| parent | 506971f46867ad00011161adf7495e7e2d680b20 (diff) | |
fix transparent borders
| -rw-r--r-- | config.def.h | 16 | ||||
| -rw-r--r-- | config.h | 8 | ||||
| -rw-r--r-- | drw.c | 2 | ||||
| -rw-r--r-- | drw.o | bin | 11128 -> 11136 bytes | |||
| -rw-r--r-- | dwm | bin | 85960 -> 86016 bytes | |||
| -rw-r--r-- | dwm.c | 86 | ||||
| -rw-r--r-- | dwm.o | bin | 73112 -> 74048 bytes |
7 files changed, 83 insertions, 29 deletions
diff --git a/config.def.h b/config.def.h index b55a0c7..d28ff55 100644 --- a/config.def.h +++ b/config.def.h @@ -1,7 +1,7 @@ /* See LICENSE file for copyright and license details. */ /* Constants */ -#define TERMINAL "xterm" +#define TERMINAL "st" #define BROWSER "librewolf" /* appearance */ @@ -47,9 +47,9 @@ static const Rule rules[] = { { "qBittorrent", NULL, NULL, 0, 1, 0, 0, -1 }, { "qBittorrent", "qbittorrent", NULL, 0, 0, 0, 0, -1 }, { "St", "st", NULL, 0, 0, 1, 0, -1 }, + { "XTerm", "xterm", NULL, 0, 0, 1, 0, -1 }, { "scrcpy", NULL, NULL, 0, 1, 0, 0, -1 }, { "LibreWolf", "Alert", NULL, 0, 1, 0, 0, -1 }, - { "Nsxiv", NULL, NULL, 0, 1, 0, 0, -1 }, { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, }; @@ -103,8 +103,8 @@ static const Key keys[] = { { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, { MODKEY|ShiftMask, XK_Return, setlayout, {0} }, { MODKEY, XK_Return, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, + { MODKEY, XK_grave, view, {.ui = ~0 } }, + { MODKEY|ShiftMask, XK_grave, tag, {.ui = ~0 } }, { MODKEY, XK_comma, focusmon, {.i = -1 } }, { MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, @@ -132,6 +132,7 @@ static const Key keys[] = { { MODKEY, XK_Escape, spawn, SHCMD(TERMINAL" -e htop")}, { MODKEY, XK_n, spawn, SHCMD(TERMINAL" -e newsboat")}, { MODKEY, XK_e, spawn, SHCMD(TERMINAL" -e lfub")}, + { MODKEY, XK_slash, spawn, SHCMD(TERMINAL" -e menu") }, { MODKEY, XK_Print, spawn, SHCMD("maimpick") }, { MODKEY, XK_Up, spawn, SHCMD("dwmvol up") }, { MODKEY, XK_Down, spawn, SHCMD("dwmvol down") }, @@ -145,15 +146,16 @@ static const Key keys[] = { { MODKEY, XK_F11, spawn, SHCMD("dwmstats") }, { MODKEY, XK_F12, spawn, SHCMD("dwmext") }, { MODKEY, XK_F8, spawn, SHCMD("dwmnet") }, - { MODKEY, XK_slash, spawn, SHCMD("demu") }, { MODKEY, XK_s, spawn, SHCMD("steam") }, { Mod1Mask|ControlMask, XK_Delete, spawn, SHCMD("slock") }, { MODKEY, XK_w, spawn, SHCMD(BROWSER) }, { MODKEY, XK_c, spawn, SHCMD("cliphist add") }, { MODKEY, XK_v, spawn, SHCMD("cliphist sel") }, { MODKEY, XK_x, spawn, SHCMD("xkill") }, - { MODKEY, XK_h, shiftview, { .i = -1 } }, - { MODKEY, XK_l, shiftview, { .i = +1 } }, + { MODKEY, XK_h, viewprev, {0} }, + { MODKEY, XK_l, viewnext, {0} }, + { MODKEY|ShiftMask, XK_h, tagtoprev, {0} }, + { MODKEY|ShiftMask, XK_l, tagtonext, {0} }, { MODKEY|ShiftMask, XK_r, quit, {1} }, /* Unused keys */ @@ -1,7 +1,7 @@ /* See LICENSE file for copyright and license details. */ /* Constants */ -#define TERMINAL "xterm" +#define TERMINAL "st" #define BROWSER "librewolf" /* appearance */ @@ -152,8 +152,10 @@ static const Key keys[] = { { MODKEY, XK_c, spawn, SHCMD("cliphist add") }, { MODKEY, XK_v, spawn, SHCMD("cliphist sel") }, { MODKEY, XK_x, spawn, SHCMD("xkill") }, - { MODKEY, XK_h, shiftview, { .i = -1 } }, - { MODKEY, XK_l, shiftview, { .i = +1 } }, + { MODKEY, XK_h, viewprev, {0} }, + { MODKEY, XK_l, viewnext, {0} }, + { MODKEY|ShiftMask, XK_h, tagtoprev, {0} }, + { MODKEY|ShiftMask, XK_l, tagtonext, {0} }, { MODKEY|ShiftMask, XK_r, quit, {1} }, /* Unused keys */ @@ -190,6 +190,8 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname) DefaultColormap(drw->dpy, drw->screen), clrname, dest)) die("error, cannot allocate color '%s'", clrname); + + dest->pixel |= 0xff << 24; } /* Wrapper to create color schemes. The caller has to call free(3) on the Binary files differBinary files differ@@ -183,7 +183,6 @@ static void focusin(XEvent *e); static void focusmon(const Arg *arg); static void focusstackvis(const Arg *arg); static void movestack(const Arg *arg); -static void shiftview(const Arg *arg); static void focusstack(int inc, int vis); static Atom getatomprop(Client *c, Atom prop); static int getrootptr(int *x, int *y); @@ -202,6 +201,12 @@ static void maprequest(XEvent *e); static void monocle(Monitor *m); static void motionnotify(XEvent *e); static void movemouse(const Arg *arg); +static unsigned int nexttag(void); +static unsigned int prevtag(void); +static void tagtonext(const Arg *arg); +static void tagtoprev(const Arg *arg); +static void viewnext(const Arg *arg); +static void viewprev(const Arg *arg); static Client *nexttiled(Client *c); static void pop(Client *c); static void propertynotify(XEvent *e); @@ -1016,21 +1021,6 @@ movestack(const Arg *arg) } void -shiftview(const Arg *arg) -{ - Arg shifted; - if(arg->i > 0) - shifted.ui = (selmon->tagset[selmon->seltags] << arg->i) - | (selmon->tagset[selmon->seltags] >> (LENGTH(tags) - arg->i)); - - else - shifted.ui = selmon->tagset[selmon->seltags] >> (- arg->i) - | selmon->tagset[selmon->seltags] << (LENGTH(tags) + arg->i); - - view(&shifted); -} - -void focusstack(int inc, int hid) { Client *c = NULL, *i; @@ -1446,6 +1436,58 @@ movemouse(const Arg *arg) } } +unsigned int +nexttag(void) +{ + unsigned int seltag = selmon->tagset[selmon->seltags]; + return seltag == (1 << (LENGTH(tags) - 1)) ? 1 : seltag << 1; +} + +unsigned int +prevtag(void) +{ + unsigned int seltag = selmon->tagset[selmon->seltags]; + return seltag == 1 ? (1 << (LENGTH(tags) - 1)) : seltag >> 1; +} + +void +tagtonext(const Arg *arg) +{ + unsigned int tmp; + + if (selmon->sel == NULL) + return; + + tmp = nexttag(); + tag(&(const Arg){.ui = tmp}); + view(&(const Arg){.ui = tmp}); +} + +void +tagtoprev(const Arg *arg) +{ + unsigned int tmp; + + if (selmon->sel == NULL) + return; + + tmp = prevtag(); + tag(&(const Arg){.ui = tmp}); + view(&(const Arg){.ui = tmp}); +} + +void +viewnext(const Arg *arg) +{ + view(&(const Arg){.ui = nexttag()}); +} + +void +viewprev(const Arg *arg) +{ + view(&(const Arg){.ui = prevtag()}); +} + Client * nexttiled(Client *c) { @@ -1695,14 +1737,20 @@ sendmon(Client *c, Monitor *m) { if (c->mon == m) return; + int hadfocus = (c == selmon->sel); unfocus(c, 1); detach(c); detachstack(c); + arrange(c->mon); c->mon = m; attach(c); attachstack(c); - focus(NULL); - arrange(NULL); + arrange(m); + if (hadfocus) { + focus(c); + restack(m); + } else + focus(NULL); } void @@ -2360,7 +2408,7 @@ void updatestatus(void) { if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) - strcpy(stext, ""); + strcpy(stext, "*"); drawbar(selmon); } |
