diff options
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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[]) { |