diff options
| author | Fuwn <[email protected]> | 2024-05-23 17:01:10 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-05-23 17:01:10 -0700 |
| commit | 7122b817bdc4f56adb8d77b548477a6dc1089987 (patch) | |
| tree | d69b4739acdf617b0bed96e98953df19352f403b | |
| parent | feat(config.h): replace default programs (diff) | |
| download | seiwm-7122b817bdc4f56adb8d77b548477a6dc1089987.tar.xz seiwm-7122b817bdc4f56adb8d77b548477a6dc1089987.zip | |
feat(config.h): reactive togglebar
| -rw-r--r-- | config.h | 2 | ||||
| -rw-r--r-- | dwm.c | 18 | ||||
| -rw-r--r-- | vanitygaps.c | 2 |
3 files changed, 20 insertions, 2 deletions
@@ -238,7 +238,7 @@ static const Key keys[] = { /* { MODKEY, XK_c, spawn, {.v = (const char*[]){ TERMINAL, "-e", "profanity", NULL } } }, */ /* { MODKEY|ShiftMask, XK_c, spawn, SHCMD("") }, */ /* V is automatically bound above in STACKKEYS */ - { MODKEY, XK_b, togglebar, {0} }, + { MODKEY, XK_b, togglebar, {.i = 2} }, /* { MODKEY|ShiftMask, XK_b, spawn, SHCMD("") }, */ /* { MODKEY, XK_n, spawn, {.v = (const char*[]){ TERMINAL, "-e", "nvim", "-c", "VimwikiIndex", NULL } } }, */ { MODKEY|ShiftMask, XK_n, spawn, SHCMD(BROWSER " https://sumi.news ; pkill -RTMIN+6 dwmblocks") }, @@ -380,6 +380,7 @@ static int (*xerrorxlib)(Display *, XErrorEvent *); static unsigned int numlockmask = 0; static int enablefullscreen = 0; static int enableoutergaps = 1; +static int manuallytoggledbar = 0; static int lrpad; /* sum of left and right padding for text */ static void (*handler[LASTEvent]) (XEvent *) = { [ButtonPress] = buttonpress, @@ -2465,6 +2466,14 @@ tagmon(const Arg *arg) void togglebar(const Arg *arg) { + if (arg != NULL && arg->i) { + if (manuallytoggledbar == 1 && arg->i == 2) { + manuallytoggledbar = 0; + } else if (manuallytoggledbar == 0 && arg->i == 2) { + manuallytoggledbar = 1; + } + } + selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar; updatebarpos(selmon); resizebarwin(selmon); @@ -2501,7 +2510,14 @@ togglefullscr(const Arg *arg) { if(selmon->sel) { setfullscreen(selmon->sel, !selmon->sel->isfullscreen); - togglebar(NULL); + + if (((!selmon->sel->isfullscreen + && !selmon->pertag->showbars[selmon->pertag->curtag]) + || (selmon->sel->isfullscreen + && selmon->pertag->showbars[selmon->pertag->curtag])) + && manuallytoggledbar == 0) { + togglebar(NULL); + } } } diff --git a/vanitygaps.c b/vanitygaps.c index 4c98e69..0877d33 100644 --- a/vanitygaps.c +++ b/vanitygaps.c @@ -26,6 +26,8 @@ static void setgaps(int oh, int ov, int ih, int iv); /* Settings */ static int enablegaps = 1; +static const int vertpad_original = vertpad; +static const int sidepad_original = sidepad; static void setgaps(int oh, int ov, int ih, int iv) |