some changes towards 4.9
authorAnselm R Garbe <garbeam@gmail.com>
Fri, 14 Mar 2008 14:35:45 +0000
changeset 1147 def76530f636
parent 1146 29b0911adab8
child 1148 d49ff154375f
some changes towards 4.9
config.anselm.h
config.def.h
config.mk
dwm.c
--- a/config.anselm.h	Thu Mar 13 16:56:11 2008 +0000
+++ b/config.anselm.h	Fri Mar 14 14:35:45 2008 +0000
@@ -14,24 +14,15 @@
 const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
 
 Rule rules[] = {
-	/* class:instance:title substr	tags ref	isfloating */
-	{ "Firefox",			tags[8],	False },
-	{ "Gimp",			NULL,		True },
-	{ "MPlayer",			NULL,		True },
-	{ "Acroread",			NULL,		True },
+	/* class	instance	title		tags ref	isfloating */
+	{ NULL,		NULL,		"Firefox",	tags[8],	False },
+	{ NULL,		NULL,		"Gimp",		NULL,		True },
+	{ NULL,		NULL,		"MPlayer",	NULL,		True },
+	{ NULL,		NULL,		"Acroread",	NULL,		True },
 };
 
-/* layout(s) */
-#define RESIZEHINTS		True	/* False - respect size hints in tiled resizals */
-#define SNAP			32	/* snap pixel */
-
-Layout layouts[] = {
-	/* symbol		function	isfloating */
-	{ "[]|",		tileh,		False }, /* first entry is default */
-	{ "[]=",		tilev,		False },
-	{ "><>",		floating,	True },
-	{ "[M]",		monocle,	True },
-};
+/* geometry function */
+void (*setgeoms)(void) = setdefgeoms;
 
 void
 setanselmgeoms(void) {
@@ -83,12 +74,24 @@
 
 void
 defgeoms(const char *arg) {
-	setgeoms = setdefaultgeoms;
+	setgeoms = setdefgeoms;
 	setgeoms();
 	updatebarpos();
 	setlayout("[]=");
 }
 
+/* layout(s) */
+#define RESIZEHINTS		True	/* False - respect size hints in tiled resizals */
+#define SNAP			32	/* snap pixel */
+
+Layout layouts[] = {
+	/* symbol		function	isfloating */
+	{ "[]|",		tileh,		False }, /* first entry is default */
+	{ "[]=",		tilev,		False },
+	{ "><>",		floating,	True },
+	{ "[M]",		monocle,	True },
+};
+
 /* key definitions */
 #define MODKEY			Mod1Mask
 Key keys[] = {
--- a/config.def.h	Thu Mar 13 16:56:11 2008 +0000
+++ b/config.def.h	Fri Mar 14 14:35:45 2008 +0000
@@ -14,13 +14,16 @@
 const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
 
 Rule rules[] = {
-	/* class:instance:title substr	tags ref	isfloating */
-	{ "Firefox",			tags[8],	False },
-	{ "Gimp",			NULL,		True },
-	{ "MPlayer",			NULL,		True },
-	{ "Acroread",			NULL,		True },
+	/* class	instance	title		tags ref	isfloating */
+	{ NULL,		NULL,		"Firefox",	tags[8],	False },
+	{ NULL,		NULL,		"Gimp",		NULL,		True },
+	{ NULL,		NULL,		"MPlayer",	NULL,		True },
+	{ NULL,		NULL,		"Acroread",	NULL,		True },
 };
 
+/* geometry function */
+void (*setgeoms)(void) = setdefgeoms;
+
 /* layout(s) */
 #define RESIZEHINTS		True	/* False - respect size hints in tiled resizals */
 #define SNAP			32	/* snap pixel */
--- a/config.mk	Thu Mar 13 16:56:11 2008 +0000
+++ b/config.mk	Fri Mar 14 14:35:45 2008 +0000
@@ -1,5 +1,5 @@
 # dwm version
-VERSION = 4.8
+VERSION = 4.9
 
 # Customize below to fit your system
 
--- a/dwm.c	Thu Mar 13 16:56:11 2008 +0000
+++ b/dwm.c	Fri Mar 14 14:35:45 2008 +0000
@@ -99,7 +99,9 @@
 } Layout; 
 
 typedef struct {
-	const char *prop;
+	const char *class;
+	const char *instance;
+	const char *title;
 	const char *tag;
 	Bool isfloating;
 } Rule;
@@ -161,7 +163,7 @@
 void run(void);
 void scan(void);
 void setclientstate(Client *c, long state);
-void setdefaultgeoms(void);
+void setdefgeoms(void);
 void setlayout(const char *arg);
 void setup(void);
 void spawn(const char *arg);
@@ -224,7 +226,6 @@
 DC dc = {0};
 Layout *lt = NULL;
 Window root, barwin;
-void (*setgeoms)(void) = setdefaultgeoms;
 
 /* configuration, allows nested code to access above variables */
 #include "config.h"
@@ -244,9 +245,9 @@
 	XGetClassHint(dpy, c->win, &ch);
 	for(i = 0; i < LENGTH(rules); i++) {
 		r = &rules[i];
-		if(strstr(c->name, r->prop)
-		|| (ch.res_class && strstr(ch.res_class, r->prop))
-		|| (ch.res_name && strstr(ch.res_name, r->prop)))
+		if(strstr(c->name, r->title)
+		|| (ch.res_class && r->class && strstr(ch.res_class, r->class))
+		|| (ch.res_name && r->instance && strstr(ch.res_name, r->instance)))
 		{
 			c->isfloating = r->isfloating;
 			if(r->tag) {
@@ -1051,7 +1052,7 @@
 }
 
 void
-monocle(void) { 
+monocle(void) {
 	Client *c;
 
 	for(c = clients; c; c = c->next)
@@ -1390,7 +1391,7 @@
 }
 
 void
-setdefaultgeoms(void) {
+setdefgeoms(void) {
 
 	/* screen dimensions */
 	sx = 0;