summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--config.arg.h6
-rw-r--r--config.default.h6
-rw-r--r--event.c22
-rw-r--r--layout.c12
-rw-r--r--tag.c12
5 files changed, 29 insertions, 29 deletions
diff --git a/config.arg.h b/config.arg.h
index ca23b24..79bdf78 100644
--- a/config.arg.h
+++ b/config.arg.h
@@ -15,7 +15,7 @@
15#define TAGS \ 15#define TAGS \
16const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL }; 16const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
17#define RULES \ 17#define RULES \
18static Rule rule[] = { \ 18static Rule rules[] = { \
19 /* class:instance:title regex tags regex isfloating */ \ 19 /* class:instance:title regex tags regex isfloating */ \
20 { "Firefox", "3", False }, \ 20 { "Firefox", "3", False }, \
21 { "Gimp", NULL, True }, \ 21 { "Gimp", NULL, True }, \
@@ -26,7 +26,7 @@ static Rule rule[] = { \
26/* layout(s) */ 26/* layout(s) */
27#include "tile.h" 27#include "tile.h"
28#define LAYOUTS \ 28#define LAYOUTS \
29static Layout layout[] = { \ 29static Layout layouts[] = { \
30 /* symbol function */ \ 30 /* symbol function */ \
31 { "[]=", tile }, /* first entry is default */ \ 31 { "[]=", tile }, /* first entry is default */ \
32 { "><>", floating }, \ 32 { "><>", floating }, \
@@ -37,7 +37,7 @@ static Layout layout[] = { \
37/* key definitions */ 37/* key definitions */
38#define MODKEY Mod1Mask 38#define MODKEY Mod1Mask
39#define KEYS \ 39#define KEYS \
40Key key[] = { \ 40Key keys[] = { \
41 /* modifier key function argument */ \ 41 /* modifier key function argument */ \
42 { MODKEY, XK_p, spawn, \ 42 { MODKEY, XK_p, spawn, \
43 "exe=`dmenu_path | dmenu -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"'" \ 43 "exe=`dmenu_path | dmenu -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"'" \
diff --git a/config.default.h b/config.default.h
index 878e0a4..4e9a16f 100644
--- a/config.default.h
+++ b/config.default.h
@@ -17,7 +17,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
17/* Query class:instance:title for regex matching info with following command: 17/* Query class:instance:title for regex matching info with following command:
18 * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */ 18 * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
19#define RULES \ 19#define RULES \
20static Rule rule[] = { \ 20static Rule rules[] = { \
21 /* class:instance:title regex tags regex isfloating */ \ 21 /* class:instance:title regex tags regex isfloating */ \
22 { "Gimp", NULL, True }, \ 22 { "Gimp", NULL, True }, \
23 { "MPlayer", NULL, True }, \ 23 { "MPlayer", NULL, True }, \
@@ -27,7 +27,7 @@ static Rule rule[] = { \
27/* layout(s) */ 27/* layout(s) */
28#include "tile.h" 28#include "tile.h"
29#define LAYOUTS \ 29#define LAYOUTS \
30static Layout layout[] = { \ 30static Layout layouts[] = { \
31 /* symbol function */ \ 31 /* symbol function */ \
32 { "[]=", tile }, /* first entry is default */ \ 32 { "[]=", tile }, /* first entry is default */ \
33 { "><>", floating }, \ 33 { "><>", floating }, \
@@ -38,7 +38,7 @@ static Layout layout[] = { \
38/* key definitions */ 38/* key definitions */
39#define MODKEY Mod1Mask 39#define MODKEY Mod1Mask
40#define KEYS \ 40#define KEYS \
41Key key[] = { \ 41Key keys[] = { \
42 /* modifier key function argument */ \ 42 /* modifier key function argument */ \
43 { MODKEY|ShiftMask, XK_Return, spawn, "exec xterm" }, \ 43 { MODKEY|ShiftMask, XK_Return, spawn, "exec xterm" }, \
44 { MODKEY, XK_p, spawn, "exe=`dmenu_path | dmenu` && exec $exe" }, \ 44 { MODKEY, XK_p, spawn, "exe=`dmenu_path | dmenu` && exec $exe" }, \
diff --git a/event.c b/event.c
index 4e240e2..b96aba9 100644
--- a/event.c
+++ b/event.c
@@ -252,18 +252,18 @@ expose(XEvent *e) {
252static void 252static void
253keypress(XEvent *e) { 253keypress(XEvent *e) {
254 KEYS 254 KEYS
255 unsigned int len = sizeof key / sizeof key[0]; 255 unsigned int len = sizeof keys / sizeof keys[0];
256 unsigned int i; 256 unsigned int i;
257 KeySym keysym; 257 KeySym keysym;
258 XKeyEvent *ev = &e->xkey; 258 XKeyEvent *ev = &e->xkey;
259 259
260 keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); 260 keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
261 for(i = 0; i < len; i++) 261 for(i = 0; i < len; i++)
262 if(keysym == key[i].keysym 262 if(keysym == keys[i].keysym
263 && CLEANMASK(key[i].mod) == CLEANMASK(ev->state)) 263 && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state))
264 { 264 {
265 if(key[i].func) 265 if(keys[i].func)
266 key[i].func(key[i].arg); 266 keys[i].func(keys[i].arg);
267 } 267 }
268} 268}
269 269
@@ -358,20 +358,20 @@ void (*handler[LASTEvent]) (XEvent *) = {
358void 358void
359grabkeys(void) { 359grabkeys(void) {
360 KEYS 360 KEYS
361 unsigned int len = sizeof key / sizeof key[0]; 361 unsigned int len = sizeof keys / sizeof keys[0];
362 unsigned int i; 362 unsigned int i;
363 KeyCode code; 363 KeyCode code;
364 364
365 XUngrabKey(dpy, AnyKey, AnyModifier, root); 365 XUngrabKey(dpy, AnyKey, AnyModifier, root);
366 for(i = 0; i < len; i++) { 366 for(i = 0; i < len; i++) {
367 code = XKeysymToKeycode(dpy, key[i].keysym); 367 code = XKeysymToKeycode(dpy, keys[i].keysym);
368 XGrabKey(dpy, code, key[i].mod, root, True, 368 XGrabKey(dpy, code, keys[i].mod, root, True,
369 GrabModeAsync, GrabModeAsync); 369 GrabModeAsync, GrabModeAsync);
370 XGrabKey(dpy, code, key[i].mod | LockMask, root, True, 370 XGrabKey(dpy, code, keys[i].mod | LockMask, root, True,
371 GrabModeAsync, GrabModeAsync); 371 GrabModeAsync, GrabModeAsync);
372 XGrabKey(dpy, code, key[i].mod | numlockmask, root, True, 372 XGrabKey(dpy, code, keys[i].mod | numlockmask, root, True,
373 GrabModeAsync, GrabModeAsync); 373 GrabModeAsync, GrabModeAsync);
374 XGrabKey(dpy, code, key[i].mod | numlockmask | LockMask, root, True, 374 XGrabKey(dpy, code, keys[i].mod | numlockmask | LockMask, root, True,
375 GrabModeAsync, GrabModeAsync); 375 GrabModeAsync, GrabModeAsync);
376 } 376 }
377} 377}
diff --git a/layout.c b/layout.c
index c467080..46e82c2 100644
--- a/layout.c
+++ b/layout.c
@@ -94,10 +94,10 @@ void
94initlayouts(void) { 94initlayouts(void) {
95 unsigned int i, w; 95 unsigned int i, w;
96 96
97 lt = &layout[0]; 97 lt = &layouts[0];
98 nlayouts = sizeof layout / sizeof layout[0]; 98 nlayouts = sizeof layouts / sizeof layouts[0];
99 for(blw = i = 0; i < nlayouts; i++) { 99 for(blw = i = 0; i < nlayouts; i++) {
100 w = textw(layout[i].symbol); 100 w = textw(layouts[i].symbol);
101 if(w > blw) 101 if(w > blw)
102 blw = w; 102 blw = w;
103 } 103 }
@@ -144,14 +144,14 @@ setlayout(const char *arg) {
144 144
145 if(!arg) { 145 if(!arg) {
146 lt++; 146 lt++;
147 if(lt == layout + nlayouts) 147 if(lt == layouts + nlayouts)
148 lt = layout; 148 lt = layouts;
149 } 149 }
150 else { 150 else {
151 i = atoi(arg); 151 i = atoi(arg);
152 if(i < 0 || i >= nlayouts) 152 if(i < 0 || i >= nlayouts)
153 return; 153 return;
154 lt = &layout[i]; 154 lt = &layouts[i];
155 } 155 }
156 if(sel) 156 if(sel)
157 arrange(); 157 arrange();
diff --git a/tag.c b/tag.c
index cf983b8..a0ddb0d 100644
--- a/tag.c
+++ b/tag.c
@@ -59,19 +59,19 @@ compileregs(void) {
59 59
60 if(regs) 60 if(regs)
61 return; 61 return;
62 nrules = sizeof rule / sizeof rule[0]; 62 nrules = sizeof rules / sizeof rules[0];
63 regs = emallocz(nrules * sizeof(Regs)); 63 regs = emallocz(nrules * sizeof(Regs));
64 for(i = 0; i < nrules; i++) { 64 for(i = 0; i < nrules; i++) {
65 if(rule[i].prop) { 65 if(rules[i].prop) {
66 reg = emallocz(sizeof(regex_t)); 66 reg = emallocz(sizeof(regex_t));
67 if(regcomp(reg, rule[i].prop, REG_EXTENDED)) 67 if(regcomp(reg, rules[i].prop, REG_EXTENDED))
68 free(reg); 68 free(reg);
69 else 69 else
70 regs[i].propregex = reg; 70 regs[i].propregex = reg;
71 } 71 }
72 if(rule[i].tags) { 72 if(rules[i].tags) {
73 reg = emallocz(sizeof(regex_t)); 73 reg = emallocz(sizeof(regex_t));
74 if(regcomp(reg, rule[i].tags, REG_EXTENDED)) 74 if(regcomp(reg, rules[i].tags, REG_EXTENDED))
75 free(reg); 75 free(reg);
76 else 76 else
77 regs[i].tagregex = reg; 77 regs[i].tagregex = reg;
@@ -124,7 +124,7 @@ settags(Client *c, Client *trans) {
124 ch.res_name ? ch.res_name : "", c->name); 124 ch.res_name ? ch.res_name : "", c->name);
125 for(i = 0; i < nrules; i++) 125 for(i = 0; i < nrules; i++)
126 if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) { 126 if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) {
127 c->isfloating = rule[i].isfloating; 127 c->isfloating = rules[i].isfloating;
128 for(j = 0; regs[i].tagregex && j < ntags; j++) { 128 for(j = 0; regs[i].tagregex && j < ntags; j++) {
129 if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) { 129 if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
130 matched = True; 130 matched = True;