From db938a01bd9b956153b6427dab970732b5d29d4f Mon Sep 17 00:00:00 2001 From: nirav Date: Mon, 10 Feb 2020 13:31:07 +0000 Subject: Add shiftview --- dwm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'dwm.c') 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[]) { -- cgit v1.2.3