Fix: no host.mk patch generated, add hideall/showall functions and bind

them to keys
This commit is contained in:
speediegq 2022-10-05 19:05:16 +02:00
parent e0ce703bd7
commit 0a976ab2c9
4 changed files with 38 additions and 1 deletions

View file

@ -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

View file

@ -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") },

View file

@ -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

View file

@ -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)
{