# HG changeset patch # User Anselm R. Garbe # Date 1197141116 -3600 # Node ID dc37f0e022f73c6b78bf82442cca4d53b99a4805 # Parent b61ffb85f69190814f51fab5e2be783ac9fe16d7 implemented reapply for re-applying the tagging rules during runtime, Mod-r diff -r b61ffb85f691 -r dc37f0e022f7 config.def.h --- a/config.def.h Sat Dec 08 19:59:51 2007 +0100 +++ b/config.def.h Sat Dec 08 20:11:56 2007 +0100 @@ -47,6 +47,7 @@ { MODKEY, XK_h, setmwfact, "-0.05" }, { MODKEY, XK_l, setmwfact, "+0.05" }, { MODKEY, XK_m, togglemax, NULL }, + { MODKEY, XK_r, reapply, NULL }, { MODKEY, XK_Return, zoom, NULL }, { MODKEY, XK_Tab, viewprevtag, NULL }, { MODKEY|ShiftMask, XK_space, togglefloating, NULL }, diff -r b61ffb85f691 -r dc37f0e022f7 dwm.1 --- a/dwm.1 Sat Dec 08 19:59:51 2007 +0100 +++ b/dwm.1 Sat Dec 08 20:11:56 2007 +0100 @@ -80,6 +80,9 @@ .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 -r b61ffb85f691 -r dc37f0e022f7 dwm.c --- a/dwm.c Sat Dec 08 19:59:51 2007 +0100 +++ b/dwm.c Sat Dec 08 20:11:56 2007 +0100 @@ -161,6 +161,7 @@ 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); @@ -1159,6 +1160,17 @@ 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) {