My configuration of sxmo fork of suckless dwm.

git clone git://watertao.xyz/programs/sxmo-dwm.git

commit a4ebfc9c59465a6ffa986751b6105e3e02de6389
parent 653315a673ac65c9ecb8748956b77c4e9db931fb
Author: Miles Alan <m@milesalan.com>
Date:   Thu,  9 Apr 2020 22:12:52 -0500

Shiftview

Diffstat:
Mconfig.def.h | 7+++++++
Mdwm.c | 16++++++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -66,6 +66,11 @@ static Key keys[] = { // TODO: hold functionality doesnt work if keybinding starts at 0 index {0, MODKEY, XK_0, view, {.ui = ~0 } }, + {0, MODKEY|ShiftMask, XK_h, shiftview, {.i = -1} }, + {0, MODKEY|ShiftMask, XK_l, tagtoright, {.i = +1} }, + {0, MODKEY, XK_h, tagtoright, {0} }, + {0, MODKEY, XK_l, tagtoright, {0} }, + {1, 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("sxmo_appmenu.sh") }, {2, 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("sxmo_appmenu.sh sys") }, {3, 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("sxmo_screenlock") }, @@ -77,6 +82,8 @@ static Key keys[] = { {1, 0, XF86XK_PowerOff, spawn, SHCMD("pkill -9 svkbd-sxmo || svkbd-sxmo") }, {2, 0, XF86XK_PowerOff, spawn, SHCMD("sxmo_blinkled.sh green & $TERM") }, {3, 0, XF86XK_PowerOff, spawn, SHCMD("sxmo_blinkled.sh green & $BROWSER") } + + }; /* button definitions */ diff --git a/dwm.c b/dwm.c @@ -2619,3 +2619,19 @@ tagtoright(const Arg *arg) { focus(NULL); 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); +} +