timplemented reapply for re-applying the tagging rules during runtime, Mod-r - … | |
git clone git://src.adamsgaard.dk/dwm | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit d66ad1457e6b1e3fc18c01767fdb499acaef3c8e | |
parent 8497f9f78195d386c7b50bc5105641a5c3f78554 | |
Author: Anselm R. Garbe <[email protected]> | |
Date: Sat, 8 Dec 2007 20:11:56 +0100 | |
implemented reapply for re-applying the tagging rules during runtime, Mod-r | |
Diffstat: | |
M config.def.h | 1 + | |
M dwm.1 | 3 +++ | |
M dwm.c | 12 ++++++++++++ | |
3 files changed, 16 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/config.def.h b/config.def.h | |
t@@ -47,6 +47,7 @@ Key keys[] = { | |
{ MODKEY, XK_h, setmwfact, … | |
{ MODKEY, XK_l, setmwfact, … | |
{ MODKEY, XK_m, togglemax, … | |
+ { MODKEY, XK_r, reapply, … | |
{ MODKEY, XK_Return, zoom, … | |
{ MODKEY, XK_Tab, viewprevtag, … | |
{ MODKEY|ShiftMask, XK_space, togglefloating, … | |
diff --git a/dwm.1 b/dwm.1 | |
t@@ -80,6 +80,9 @@ Increases the master area width about 5% (tiled layout only). | |
.B Mod1\-m | |
Toggles maximization of current window. | |
.TP | |
+.B Mod1\-r | |
+Re-applies tagging rules to all windows. | |
+.TP | |
.B Mod1\-Shift\-[1..n] | |
Apply | |
.RB nth | |
diff --git a/dwm.c b/dwm.c | |
t@@ -161,6 +161,7 @@ void movemouse(Client *c); | |
Client *nexttiled(Client *c); | |
void propertynotify(XEvent *e); | |
void quit(const char *arg); | |
+void reapply(const char *arg); | |
void resize(Client *c, int x, int y, int w, int h, Bool sizehints); | |
void resizemouse(Client *c); | |
void restack(void); | |
t@@ -1159,6 +1160,17 @@ quit(const char *arg) { | |
readin = running = False; | |
} | |
+void | |
+reapply(const char *arg) { | |
+ static Bool zerotags[LENGTH(tags)] = { 0 }; | |
+ Client *c; | |
+ | |
+ for(c = clients; c; c = c->next) { | |
+ memcpy(c->tags, zerotags, sizeof zerotags); | |
+ applyrules(c); | |
+ } | |
+ arrange(); | |
+} | |
void | |
resize(Client *c, int x, int y, int w, int h, Bool sizehints) { |