diff options
author | nirav <nirav@airmail.cc> | 2020-02-10 13:31:07 +0000 |
---|---|---|
committer | nirav <nirav@airmail.cc> | 2020-02-10 13:32:15 +0000 |
commit | db938a01bd9b956153b6427dab970732b5d29d4f (patch) | |
tree | ea12ce60bab76a7a00c1df90b615040a7e7cb984 | |
parent | c6cdd3bf42f074689946ad73b1be64ee53d1a032 (diff) | |
download | dwm-db938a01bd9b956153b6427dab970732b5d29d4f.tar.gz dwm-db938a01bd9b956153b6427dab970732b5d29d4f.zip |
Add shiftview
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | config.h | 4 | ||||
-rw-r--r-- | dwm.c | 16 |
3 files changed, 24 insertions, 0 deletions
@@ -46,3 +46,7 @@ Configuration ------------- The configuration of dwm is done by creating a custom config.h and (re)compiling the source code. + +Patches applied +------------- +Shiftview - https://lists.suckless.org/dev/1104/7590.html @@ -94,6 +94,8 @@ static Key keys[] = { TAGKEYS( XK_9, 8) { MODKEY|ShiftMask, XK_q, quit, {0} }, { MODKEY, XK_q, killclient, {0} }, + { MODKEY, XK_a, shiftview, {.i = -1} }, + { MODKEY, XK_d, shiftview, {.i = +1} }, }; /* button definitions */ @@ -111,5 +113,7 @@ static Button buttons[] = { { ClkTagBar, 0, Button3, toggleview, {0} }, { ClkTagBar, MODKEY, Button1, tag, {0} }, { ClkTagBar, MODKEY, Button3, toggletag, {0} }, + { ClkTagBar, 0, Button4, shiftview, {.i = -1} }, + { ClkTagBar, 0, Button5, shiftview, {.i = +1} }, }; @@ -233,6 +233,7 @@ static int xerror(Display *dpy, XErrorEvent *ee); static int xerrordummy(Display *dpy, XErrorEvent *ee); static int xerrorstart(Display *dpy, XErrorEvent *ee); static void zoom(const Arg *arg); +static void shiftview(const Arg *arg); /* variables */ static const char broken[] = "broken"; @@ -2124,6 +2125,21 @@ zoom(const Arg *arg) pop(c); } +void +shiftview(const Arg *arg) { + Arg shifted; + + if(arg->i > 0) // left circular shift + shifted.ui = (selmon->tagset[selmon->seltags] << arg->i) + | (selmon->tagset[selmon->seltags] >> (LENGTH(tags) - arg->i)); + + else // right circular shift + shifted.ui = selmon->tagset[selmon->seltags] >> (- arg->i) + | selmon->tagset[selmon->seltags] << (LENGTH(tags) + arg->i); + + view(&shifted); +} + int main(int argc, char *argv[]) { |