From 6c3dba17fba42efbbfedd4f2f481c5953ddaae56 Mon Sep 17 00:00:00 2001 From: speedie Date: Wed, 7 Dec 2022 20:36:56 +0100 Subject: [PATCH] a few changes --- keybinds.h | 2 ++ speedwm.c | 25 +++++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/keybinds.h b/keybinds.h index 45f4451..fbd5f75 100644 --- a/keybinds.h +++ b/keybinds.h @@ -140,6 +140,8 @@ static Key keys[] = { { MODIFIER1|SHIFT, -1, XK_comma, setbpgaps, {.i = -1 } }, { MODIFIER1|CONTROL, -1, XK_i, incstackcount, {.i = +1 } }, { MODIFIER1|CONTROL, -1, XK_u, incstackcount, {.i = -1 } }, + { MODIFIER1|CONTROL|SHIFT, -1, XK_period, setbpgaps, {.i = +5 } }, + { MODIFIER1|CONTROL|SHIFT, -1, XK_comma, setbpgaps, {.i = -5 } }, /* Floating mode keybinds */ { MODIFIER1, -1, XK_w, moveresizeaspect, {.i = +24} }, diff --git a/speedwm.c b/speedwm.c index 3b80082..0d1e2cd 100644 --- a/speedwm.c +++ b/speedwm.c @@ -2750,11 +2750,15 @@ handlexevent(struct epoll_event *ev) void incmastercount(const Arg *arg) { - if (i3mastercount) { - selmon->mastercount = selmon->pertag->mastercounts[selmon->pertag->curtag] = !selmon->mastercount; - } else { - selmon->mastercount = selmon->pertag->mastercounts[selmon->pertag->curtag] = MAX(selmon->mastercount + arg->i, 0); - } + Client *c; + int n; + for (n = 0, c = nexttiled(selmon->clients); c; c = nexttiled(c->next), n++); + if (i3mastercount) { + selmon->mastercount = selmon->pertag->mastercounts[selmon->pertag->curtag] = MIN(!selmon->mastercount,n); + } else { + selmon->mastercount = selmon->pertag->mastercounts[selmon->pertag->curtag] = MAX(MIN(selmon->mastercount,n) + arg->i, 0); + } + arrange(selmon); } @@ -5507,11 +5511,6 @@ togglesystray(const Arg *arg) { selmon->hidesystray = !selmon->hidesystray; - /* - if (selmon->hidesystray) - removesystrayicon(systray->icons); - */ - updatebarpos(selmon); updatestatus(); } @@ -5785,12 +5784,10 @@ void togglebarpos(const Arg *arg) { Bar *bar; - Monitor *m = bar->mon; - bar->barposition = !bar->barposition; + barposition = !barposition; updatebarpos(selmon); - for (bar = selmon->bar; bar; bar = bar->next) - XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); + XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); arrange(selmon); }