| dwm-toggleallmons-6.4.diff - sites - public wiki contents of suckless.org | |
| git clone git://git.suckless.org/sites | |
| Log | |
| Files | |
| Refs | |
| --- | |
| dwm-toggleallmons-6.4.diff (1464B) | |
| --- | |
| 1 diff --git a/config.def.h b/config.def.h | |
| 2 index 061ad66..d702080 100644 | |
| 3 --- a/config.def.h | |
| 4 +++ b/config.def.h | |
| 5 @@ -72,6 +72,7 @@ static const Key keys[] = { | |
| 6 { MODKEY, XK_l, setmfact, {.f … | |
| 7 { MODKEY, XK_Return, zoom, {0} … | |
| 8 { MODKEY, XK_Tab, view, {0} … | |
| 9 + { MODKEY|ShiftMask, XK_Tab, toggleall, {0} … | |
| 10 { MODKEY|ShiftMask, XK_c, killclient, {0} … | |
| 11 { MODKEY, XK_t, setlayout, {.v … | |
| 12 { MODKEY, XK_f, setlayout, {.v … | |
| 13 diff --git a/dwm.c b/dwm.c | |
| 14 index e5efb6a..f01009f 100644 | |
| 15 --- a/dwm.c | |
| 16 +++ b/dwm.c | |
| 17 @@ -210,6 +210,7 @@ static void spawn(const Arg *arg); | |
| 18 static void tag(const Arg *arg); | |
| 19 static void tagmon(const Arg *arg); | |
| 20 static void tile(Monitor *m); | |
| 21 +static void toggleall(const Arg *arg); | |
| 22 static void togglebar(const Arg *arg); | |
| 23 static void togglefloating(const Arg *arg); | |
| 24 static void toggletag(const Arg *arg); | |
| 25 @@ -1694,6 +1695,21 @@ tile(Monitor *m) | |
| 26 } | |
| 27 } | |
| 28 | |
| 29 +void | |
| 30 +toggleall(const Arg *arg) | |
| 31 +{ | |
| 32 + Monitor* m; | |
| 33 + for(m = mons; m; m = m->next){ | |
| 34 + if ((arg->ui & TAGMASK) == m->tagset[m->seltags]) | |
| 35 + return; | |
| 36 + m->seltags ^= 1; /* toggle sel tagset */ | |
| 37 + if (arg->ui & TAGMASK) | |
| 38 + m->tagset[m->seltags] = arg->ui & TAGMASK; | |
| 39 + focus(NULL); | |
| 40 + arrange(m); | |
| 41 + } | |
| 42 +} | |
| 43 + | |
| 44 void | |
| 45 togglebar(const Arg *arg) | |
| 46 { |