summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2021-10-06 02:55:26 +0200
committerjonsykkel <jonrevold@gmail.com>2021-10-06 08:38:45 +0000
commit99c99539b5ec879b38e0d756030719a1472900b5 (patch)
tree2018554474e2b0ac2e3d9ff0c7b5cda91a121c15
parenta8f1bf4e50ea938bf15c003ce12fdf26a1738656 (diff)
downloaddwm-99c99539b5ec879b38e0d756030719a1472900b5.tar.gz
didnt test
-rw-r--r--config.h6
-rw-r--r--dwm.c15
2 files changed, 19 insertions, 2 deletions
diff --git a/config.h b/config.h
index 22c2660..1541515 100644
--- a/config.h
+++ b/config.h
@@ -75,8 +75,10 @@ static Key keys[] = {
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
- { MODKEY, XK_i, incnmaster, {.i = +1 } },
- { MODKEY, XK_d, incnmaster, {.i = -1 } },
+ { MODKEY, XK_o, incnmaster, {.i = +1 } },
+ { MODKEY, XK_y, incnmaster, {.i = -1 } },
+ { MODKEY, XK_u, incview, {.i = +1 } },
+ { MODKEY, XK_i, incview, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} },
diff --git a/dwm.c b/dwm.c
index ae63332..203ba98 100644
--- a/dwm.c
+++ b/dwm.c
@@ -229,6 +229,7 @@ static void updatetitle(Client *c);
static void updatewindowtype(Client *c);
static void updatewmhints(Client *c);
static void view(const Arg *arg);
+static void incview(const Arg *arg);
static Client *wintoclient(Window w);
static Monitor *wintomon(Window w);
static int xerror(Display *dpy, XErrorEvent *ee);
@@ -2127,6 +2128,20 @@ view(const Arg *arg)
arrange(selmon);
}
+void
+incview(const Arg *arg)
+{
+ unsigned i;
+
+ i = __builtin_ctz(selmon->tagset[selmon->seltags]);
+ if((unsigned)(i+arg->i) >= LENGTH(tags)) return;
+ i += arg->i;
+ selmon->seltags ^= 1;
+ selmon->tagset[selmon->seltags] = 1<<i;
+ focus(NULL);
+ arrange(selmon);
+}
+
Client *
wintoclient(Window w)
{