aboutsummaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authornirav <nirav@airmail.cc>2020-02-10 13:31:07 +0000
committernirav <nirav@airmail.cc>2020-02-10 13:32:15 +0000
commitdb938a01bd9b956153b6427dab970732b5d29d4f (patch)
treeea12ce60bab76a7a00c1df90b615040a7e7cb984 /dwm.c
parentc6cdd3bf42f074689946ad73b1be64ee53d1a032 (diff)
downloaddwm-db938a01bd9b956153b6427dab970732b5d29d4f.tar.gz
dwm-db938a01bd9b956153b6427dab970732b5d29d4f.zip
Add shiftview
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/dwm.c b/dwm.c
index 8f8a72a..df8e268 100644
--- a/dwm.c
+++ b/dwm.c
@@ -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[])
{