diff options
| author | pml68 <pml31@protonmail.com> | 2024-02-10 12:43:56 +0100 |
|---|---|---|
| committer | pml68 <pml31@protonmail.com> | 2024-02-10 12:43:56 +0100 |
| commit | cc327e2c66a792886429df1c429fe104ab11eb45 (patch) | |
| tree | 2fb45b3d1f7b27c78fc8af47fa031a87b86f00f6 /dwm/dwm.c | |
| parent | feat: add .bashrc (diff) | |
| download | suckless-setup-cc327e2c66a792886429df1c429fe104ab11eb45.tar.gz | |
feat: add shiftviewclients patch, remove unused tagkeys
Diffstat (limited to 'dwm/dwm.c')
| -rw-r--r-- | dwm/dwm.c | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -205,6 +205,7 @@ static void setlayout(const Arg *arg); static void setmfact(const Arg *arg); static void setup(void); static void seturgent(Client *c, int urg); +static void shiftviewclients(const Arg *arg); static void showhide(Client *c); static void spawn(const Arg *arg); static void tag(const Arg *arg); @@ -1659,6 +1660,46 @@ seturgent(Client *c, int urg) } void +shiftviewclients(const Arg *arg) +{ + Arg shifted; + Client *c; + unsigned int tagmask = 0; + + for (c = selmon->clients; c; c = c->next) + #if SCRATCHPADS_PATCH + if (!(c->tags & SPTAGMASK)) + tagmask = tagmask | c->tags; + #else + tagmask = tagmask | c->tags; + #endif // SCRATCHPADS_PATCH + + #if SCRATCHPADS_PATCH + shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK; + #else + shifted.ui = selmon->tagset[selmon->seltags]; + #endif // SCRATCHPADS_PATCH + if (arg->i > 0) // left circular shift + do { + shifted.ui = (shifted.ui << arg->i) + | (shifted.ui >> (LENGTH(tags) - arg->i)); + #if SCRATCHPADS_PATCH + shifted.ui &= ~SPTAGMASK; + #endif // SCRATCHPADS_PATCH + } while (tagmask && !(shifted.ui & tagmask)); + else // right circular shift + do { + shifted.ui = (shifted.ui >> (- arg->i) + | shifted.ui << (LENGTH(tags) + arg->i)); + #if SCRATCHPADS_PATCH + shifted.ui &= ~SPTAGMASK; + #endif // SCRATCHPADS_PATCH + } while (tagmask && !(shifted.ui & tagmask)); + + view(&shifted); +} + +void showhide(Client *c) { if (!c) |
