about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-12-08 20:11:56 +0100
committerAnselm R. Garbe <garbeam@gmail.com>2007-12-08 20:11:56 +0100
commitd66ad1457e6b1e3fc18c01767fdb499acaef3c8e (patch)
tree1b8f5d8ccda22f343d402159211b1b900e6f95e8
parent8497f9f78195d386c7b50bc5105641a5c3f78554 (diff)
downloaddwm-d66ad1457e6b1e3fc18c01767fdb499acaef3c8e.tar.gz
implemented reapply for re-applying the tagging rules during runtime, Mod-r
-rw-r--r--config.def.h1
-rw-r--r--dwm.13
-rw-r--r--dwm.c12
3 files changed, 16 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h
index 169aeec..d76bd0b 100644
--- a/config.def.h
+++ b/config.def.h
@@ -47,6 +47,7 @@ Key keys[] = {
 	{ 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 --git a/dwm.1 b/dwm.1
index ba6b3f4..aff7bed 100644
--- a/dwm.1
+++ b/dwm.1
@@ -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
index 53e5cb2..0af37d6 100644
--- a/dwm.c
+++ b/dwm.c
@@ -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);
@@ -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) {
;id=4a39d12d4568f76ebf45b34cec722d8e0bcf1207'>4a39d12d ^
a654e4ec ^
e5c11a51 ^
70f4e9b6 ^
4a39d12d ^
9e751bb8 ^

672e3e50 ^

a654e4ec ^



e5c11a51 ^






















a654e4ec ^

672e3e50 ^
e5c11a51 ^
a654e4ec ^
204dae92 ^







201458e3 ^
204dae92 ^






















201458e3 ^
204dae92 ^







201458e3 ^
204dae92 ^

201458e3 ^

9e751bb8 ^
201458e3 ^
204dae92 ^


201458e3 ^

9e751bb8 ^




204dae92 ^




201458e3 ^
204dae92 ^

672e3e50 ^


a654e4ec ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133