This is my very first patch.
And my very first post on the list! :)
The patch allows ppl to have chosen window class start maximized.

I have a tag for almost every program I use, so I can always go full
screen. Some program does not save his size on exit (ex. xterm),
so every time it starts I have to maximize the window.
Thats frustrating when you start lots of programs with a startup script.

With this patch, Rule struct gets a "ismaxed" bool which can be set to
true/false through config.h. Quite simple.

Wyrmskull
diff -up dwm-4.3/config.default.h dwm-4.3-startmaximized/config.default.h
--- dwm-4.3/config.default.h			2007-07-14 21:11:29.000000000 +0200
+++ dwm-4.3-startmaximized/config.default.h	2007-07-24 14:37:03.000000000 +0200
@@ -18,10 +18,10 @@ const char *tags[] = { "1", "2", "3", "4
  * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
 #define RULES \
 static Rule rule[] = { \
-	/* class:instance:title regex	tags regex	isfloating */ \
-	{ "Gimp",			NULL,		True }, \
-	{ "MPlayer",			NULL,		True }, \
-	{ "Acroread",			NULL,		True }, \
+	/* class:instance:title regex	tags regex	isfloating	ismaxed	*/ \
+	{ "Gimp",			NULL,		True,		True	}, \
+	{ "MPlayer",			NULL,		True,		False	}, \
+	{ "Acroread",			NULL,		True,		True	}, \
 };
 
 /* layout(s) */
diff -up dwm-4.3/tag.c dwm-4.3-startmaximized/tag.c
--- dwm-4.3/tag.c			2007-07-14 21:11:29.000000000 +0200
+++ dwm-4.3-startmaximized/tag.c	2007-07-24 13:14:23.000000000 +0200
@@ -11,6 +11,7 @@ typedef struct {
 	const char *prop;
 	const char *tags;
 	Bool isfloating;
+	Bool ismaxed;
 } Rule;
 
 typedef struct {
@@ -82,6 +83,10 @@ settags(Client *c, Client *trans) {
 		for(i = 0; i < nrules; i++)
 			if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) {
 				c->isfloating = rule[i].isfloating;
+                                if(rule[i].ismaxed) {
+					sel = c;
+                                	togglemax(NULL);
+				}
 				for(j = 0; regs[i].tagregex && j < ntags; j++) {
 					if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
 						matched = True;

Reply via email to