summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.anselm.h37
-rw-r--r--config.def.h13
-rw-r--r--config.mk2
-rw-r--r--dwm.c17
4 files changed, 38 insertions, 31 deletions
diff --git a/config.anselm.h b/config.anselm.h
index aef5947..09cccd1 100644
--- a/config.anselm.h
+++ b/config.anselm.h
@@ -14,24 +14,15 @@
14const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 14const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
15 15
16Rule rules[] = { 16Rule rules[] = {
17 /* class:instance:title substr tags ref isfloating */ 17 /* class instance title tags ref isfloating */
18 { "Firefox", tags[8], False }, 18 { NULL, NULL, "Firefox", tags[8], False },
19 { "Gimp", NULL, True }, 19 { NULL, NULL, "Gimp", NULL, True },
20 { "MPlayer", NULL, True }, 20 { NULL, NULL, "MPlayer", NULL, True },
21 { "Acroread", NULL, True }, 21 { NULL, NULL, "Acroread", NULL, True },
22}; 22};
23 23
24/* layout(s) */ 24/* geometry function */
25#define RESIZEHINTS True /* False - respect size hints in tiled resizals */ 25void (*setgeoms)(void) = setdefgeoms;
26#define SNAP 32 /* snap pixel */
27
28Layout layouts[] = {
29 /* symbol function isfloating */
30 { "[]|", tileh, False }, /* first entry is default */
31 { "[]=", tilev, False },
32 { "><>", floating, True },
33 { "[M]", monocle, True },
34};
35 26
36void 27void
37setanselmgeoms(void) { 28setanselmgeoms(void) {
@@ -83,12 +74,24 @@ anselmgeoms(const char *arg) {
83 74
84void 75void
85defgeoms(const char *arg) { 76defgeoms(const char *arg) {
86 setgeoms = setdefaultgeoms; 77 setgeoms = setdefgeoms;
87 setgeoms(); 78 setgeoms();
88 updatebarpos(); 79 updatebarpos();
89 setlayout("[]="); 80 setlayout("[]=");
90} 81}
91 82
83/* layout(s) */
84#define RESIZEHINTS True /* False - respect size hints in tiled resizals */
85#define SNAP 32 /* snap pixel */
86
87Layout layouts[] = {
88 /* symbol function isfloating */
89 { "[]|", tileh, False }, /* first entry is default */
90 { "[]=", tilev, False },
91 { "><>", floating, True },
92 { "[M]", monocle, True },
93};
94
92/* key definitions */ 95/* key definitions */
93#define MODKEY Mod1Mask 96#define MODKEY Mod1Mask
94Key keys[] = { 97Key keys[] = {
diff --git a/config.def.h b/config.def.h
index c1eedd4..4254c43 100644
--- a/config.def.h
+++ b/config.def.h
@@ -14,13 +14,16 @@
14const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 14const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
15 15
16Rule rules[] = { 16Rule rules[] = {
17 /* class:instance:title substr tags ref isfloating */ 17 /* class instance title tags ref isfloating */
18 { "Firefox", tags[8], False }, 18 { NULL, NULL, "Firefox", tags[8], False },
19 { "Gimp", NULL, True }, 19 { NULL, NULL, "Gimp", NULL, True },
20 { "MPlayer", NULL, True }, 20 { NULL, NULL, "MPlayer", NULL, True },
21 { "Acroread", NULL, True }, 21 { NULL, NULL, "Acroread", NULL, True },
22}; 22};
23 23
24/* geometry function */
25void (*setgeoms)(void) = setdefgeoms;
26
24/* layout(s) */ 27/* layout(s) */
25#define RESIZEHINTS True /* False - respect size hints in tiled resizals */ 28#define RESIZEHINTS True /* False - respect size hints in tiled resizals */
26#define SNAP 32 /* snap pixel */ 29#define SNAP 32 /* snap pixel */
diff --git a/config.mk b/config.mk
index b63e2ca..5176248 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
1# dwm version 1# dwm version
2VERSION = 4.8 2VERSION = 4.9
3 3
4# Customize below to fit your system 4# Customize below to fit your system
5 5
diff --git a/dwm.c b/dwm.c
index a54329a..3f896dc 100644
--- a/dwm.c
+++ b/dwm.c
@@ -99,7 +99,9 @@ typedef struct {
99} Layout; 99} Layout;
100 100
101typedef struct { 101typedef struct {
102 const char *prop; 102 const char *class;
103 const char *instance;
104 const char *title;
103 const char *tag; 105 const char *tag;
104 Bool isfloating; 106 Bool isfloating;
105} Rule; 107} Rule;
@@ -161,7 +163,7 @@ void restack(void);
161void run(void); 163void run(void);
162void scan(void); 164void scan(void);
163void setclientstate(Client *c, long state); 165void setclientstate(Client *c, long state);
164void setdefaultgeoms(void); 166void setdefgeoms(void);
165void setlayout(const char *arg); 167void setlayout(const char *arg);
166void setup(void); 168void setup(void);
167void spawn(const char *arg); 169void spawn(const char *arg);
@@ -224,7 +226,6 @@ Display *dpy;
224DC dc = {0}; 226DC dc = {0};
225Layout *lt = NULL; 227Layout *lt = NULL;
226Window root, barwin; 228Window root, barwin;
227void (*setgeoms)(void) = setdefaultgeoms;
228 229
229/* configuration, allows nested code to access above variables */ 230/* configuration, allows nested code to access above variables */
230#include "config.h" 231#include "config.h"
@@ -244,9 +245,9 @@ applyrules(Client *c) {
244 XGetClassHint(dpy, c->win, &ch); 245 XGetClassHint(dpy, c->win, &ch);
245 for(i = 0; i < LENGTH(rules); i++) { 246 for(i = 0; i < LENGTH(rules); i++) {
246 r = &rules[i]; 247 r = &rules[i];
247 if(strstr(c->name, r->prop) 248 if(strstr(c->name, r->title)
248 || (ch.res_class && strstr(ch.res_class, r->prop)) 249 || (ch.res_class && r->class && strstr(ch.res_class, r->class))
249 || (ch.res_name && strstr(ch.res_name, r->prop))) 250 || (ch.res_name && r->instance && strstr(ch.res_name, r->instance)))
250 { 251 {
251 c->isfloating = r->isfloating; 252 c->isfloating = r->isfloating;
252 if(r->tag) { 253 if(r->tag) {
@@ -1051,7 +1052,7 @@ maprequest(XEvent *e) {
1051} 1052}
1052 1053
1053void 1054void
1054monocle(void) { 1055monocle(void) {
1055 Client *c; 1056 Client *c;
1056 1057
1057 for(c = clients; c; c = c->next) 1058 for(c = clients; c; c = c->next)
@@ -1390,7 +1391,7 @@ setclientstate(Client *c, long state) {
1390} 1391}
1391 1392
1392void 1393void
1393setdefaultgeoms(void) { 1394setdefgeoms(void) {
1394 1395
1395 /* screen dimensions */ 1396 /* screen dimensions */
1396 sx = 0; 1397 sx = 0;