summaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authortsxv478 <vt0451@yandex.ru>2023-01-10 00:43:18 +0300
committertsxv478 <vt0451@yandex.ru>2023-01-10 00:43:18 +0300
commitdb6d84374aeee755bb0feeb6707a3be3c1c5f7f1 (patch)
treef2b32310e65cf59ad3210a5430fbdf8d6ead6c6d /dwm.c
parent801d168c98a17852ca2b06c09194d6b0e3d84ac0 (diff)
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 5e2fc17..046b8bf 100644
--- a/dwm.c
+++ b/dwm.c
@@ -254,6 +254,7 @@ static void updatetitle(Client *c);
static void updatewindowtype(Client *c);
static void updatewmhints(Client *c);
static void view(const Arg *arg);
+static void shiftview(const Arg *arg);
static Client *wintoclient(Window w);
static Monitor *wintomon(Window w);
static int xerror(Display *dpy, XErrorEvent *ee);
@@ -2399,6 +2400,21 @@ view(const Arg *arg)
arrange(selmon);
}
+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);
+}
+
pid_t
winpid(Window w)
{