diff --git a/docs/keybinds b/docs/keybinds index beee795..e8e4fbd 100644 --- a/docs/keybinds +++ b/docs/keybinds @@ -35,6 +35,8 @@ - Super+a/d | Increase/decrease size of each window - Super+o | Hide a window - Super+Control+o | Show a hidden focused window + - Super+Control+Shift+o | Show all hidden windows + - Super+Control+Shift+p | Hide all windows - Super+Control+a/d | Move to the next/previous tag - Super+Minus | Show the scratchpad - Super+Equal | Remove the scratchpad diff --git a/keybinds.h b/keybinds.h index eace6f0..b2e62e1 100644 --- a/keybinds.h +++ b/keybinds.h @@ -153,6 +153,8 @@ static const Key keys[] = { /* Hide/Show keybinds */ { MODIFIER1, -1, XK_o, hide, {0} }, { MODIFIER1|CONTROL, -1, XK_o, show, {0} }, + { MODIFIER1|CONTROL|SHIFT, -1, XK_o, showall, {0} }, + { MODIFIER1|CONTROL|SHIFT, -1, XK_p, hideall, {0} }, /* Chained keybinds */ { MODIFIER1, XK_c, XK_w, spawn, RCMD(TERMINAL "speedwm-core -curl-weather") }, diff --git a/scripts/mkpatch b/scripts/mkpatch index dd83e2d..c48e2ea 100755 --- a/scripts/mkpatch +++ b/scripts/mkpatch @@ -11,7 +11,7 @@ CP() { cp docs/options.def.mk /tmp/options.mk cp docs/toggle.def.h /tmp/toggle.h cp docs/toggle.def.mk /tmp/toggle.mk - cp docs/host.mk /tmp/host.mk + cp docs/host.def.mk /tmp/host.mk cp docs/keybinds.def.h /tmp/keybinds.h cp docs/rules.def.h /tmp/rules.h cp docs/status.def /tmp/status diff --git a/speedwm.c b/speedwm.c index c239253..29b4218 100644 --- a/speedwm.c +++ b/speedwm.c @@ -483,6 +483,8 @@ static void setupepoll(void); #endif static void seturgent(Client *c, int urg); static void show(const Arg *arg); +static void showall(const Arg *arg); +static void hideall(const Arg *arg); static void showwin(Client *c); static void showhide(Client *c); #if USETAGPREVIEW @@ -1169,7 +1171,9 @@ buttonpress(XEvent *e) } } } + } + else if ((c = wintoclient(ev->window))) { } else if ((c = wintoclient(ev->window))) { focus(c); restack(selmon); @@ -2685,6 +2689,35 @@ show(const Arg *arg) showwin(selmon->sel); } +void +showall(const Arg *arg) +{ + Client *c = NULL; + selmon->hidsel = 0; + for (c = selmon->clients; c; c = c->next) { + if (ISVISIBLE(c)) + showwin(c); + } + if (!selmon->sel) { + for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next); + if (c) + focus(c); + } + restack(selmon); +} + +void +hideall(const Arg *arg) +{ + Client *c = NULL; + for (c = selmon->clients; c; c = c->next) { + hidewin(c); + hidewin(selmon->sel); + } + + restack(selmon); +} + void showwin(Client *c) {