about summary refs log tree commit diff
path: root/parse.y
diff options
context:
space:
mode:
authoroga <oga>2008-04-15 18:46:58 +0000
committeroga <oga>2008-04-15 18:46:58 +0000
commit3a94c57afc6067c60b639944ef2042b0d73fb47e (patch)
tree803a2c9146119a6e3971f98e93b4df41dfa6e740 /parse.y
parent4bbb472a25c62b8266de2225c5f98b96ab829e1c (diff)
downloadcwm-3a94c57afc6067c60b639944ef2042b0d73fb47e.tar.gz
cwm-3a94c57afc6067c60b639944ef2042b0d73fb47e.tar.xz
cwm-3a94c57afc6067c60b639944ef2042b0d73fb47e.zip
Add "gap" support to .cwmrc. The options put in here make gaps on the edge
of the screen where an application won't be {,vert}maximized over. used for
placing a statusbar or something like xclock.

Patch from Edd Barrett, with input from myself and okan. Thanks!

ok okan@.
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y12
1 files changed, 10 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 7322bbe..fbe13ba 100644
--- a/parse.y
+++ b/parse.y
@@ -65,7 +65,7 @@ typedef struct {
 
 %}
 
-%token	FONTNAME STICKY
+%token	FONTNAME STICKY GAP
 %token	AUTOGROUP BIND COMMAND IGNORE
 %token	YES NO
 %token	ERROR
@@ -161,8 +161,13 @@ main		: FONTNAME STRING		{
 			free($2);
 			free($3);
 		}
+		| GAP NUMBER NUMBER NUMBER NUMBER {
+			conf->gap_top = $2;
+			conf->gap_bottom = $3;
+			conf->gap_left = $4;
+			conf->gap_right = $5;
+		}
 		;
-
 %%
 
 struct keywords {
@@ -199,6 +204,7 @@ lookup(char *s)
 		{ "bind",		BIND},
 		{ "command",		COMMAND},
 		{ "fontname",		FONTNAME},
+		{ "gap",		GAP},
 		{ "ignore",		IGNORE},
 		{ "no",			NO},
 		{ "sticky",		STICKY},
@@ -574,6 +580,8 @@ parse_config(const char *filename, struct conf *xconf)
 		strlcpy(xconf->lockpath, conf->lockpath, sizeof(xconf->lockpath));
 
 		xconf->DefaultFontName = conf->DefaultFontName;
+
+		bcopy(&(conf->gap_top), &(xconf->gap_top), sizeof(int) * 4);
 	}
 
 	free(conf);