summaryrefslogtreecommitdiff
path: root/app/cwm/parse.y
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2008-04-15 18:46:59 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2008-04-15 18:46:59 +0000
commitfe4284d4c2deef28f27802c5fcefa2ba8e1a699b (patch)
tree6e893099f7b0236238d0fd8d87ac66335e28f2e6 /app/cwm/parse.y
parentbf5b496da2aa6b32fa31ce8436562ba05f428c6d (diff)
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 'app/cwm/parse.y')
-rw-r--r--app/cwm/parse.y14
1 files changed, 11 insertions, 3 deletions
diff --git a/app/cwm/parse.y b/app/cwm/parse.y
index b40e5cd9b..947d09c54 100644
--- a/app/cwm/parse.y
+++ b/app/cwm/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.2 2008/04/15 18:22:08 okan Exp $ */
+/* $OpenBSD: parse.y,v 1.3 2008/04/15 18:46:58 oga Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -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);