summary refs log tree commit diff
path: root/parse.y
diff options
context:
space:
mode:
authorokan <okan>2020-04-16 13:32:35 +0000
committerokan <okan>2020-04-16 13:32:35 +0000
commit6407eb9bc1380d879f354c0331dbb5ea5302fe51 (patch)
tree7d49473b40db245157831e6b0a8df3fc995e3ded /parse.y
parent6afdd483c774925dacc39dcc2b290d3bbfacdf21 (diff)
downloadcwm-6407eb9bc1380d879f354c0331dbb5ea5302fe51.tar.gz
cwm-6407eb9bc1380d879f354c0331dbb5ea5302fe51.tar.xz
cwm-6407eb9bc1380d879f354c0331dbb5ea5302fe51.zip
Allow configuring a percentage window size of the master window during
htile/vtile actions. From Uwe Werler, with a few manpage tweaks.
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y18
1 files changed, 17 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 04e7bd4..0138fdb 100644
--- a/parse.y
+++ b/parse.y
@@ -71,7 +71,7 @@ typedef struct {
 %token	BINDKEY UNBINDKEY BINDMOUSE UNBINDMOUSE
 %token	FONTNAME STICKY GAP
 %token	AUTOGROUP COMMAND IGNORE WM
-%token	YES NO BORDERWIDTH MOVEAMOUNT
+%token	YES NO BORDERWIDTH MOVEAMOUNT HTILE VTILE
 %token	COLOR SNAPDIST
 %token	ACTIVEBORDER INACTIVEBORDER URGENCYBORDER
 %token	GROUPBORDER UNGROUPBORDER
@@ -122,6 +122,20 @@ main		: FONTNAME STRING		{
 			}
 			conf->bwidth = $2;
 		}
+		| HTILE NUMBER {
+			if ($2 < 0 || $2 > 99) {
+				yyerror("invalid htile percent");
+				YYERROR;
+			}
+			conf->htile = $2;
+		}
+		| VTILE NUMBER {
+			if ($2 < 0 || $2 > 99) {
+				yyerror("invalid vtile percent");
+				YYERROR;
+			}
+			conf->vtile = $2;
+		}
 		| MOVEAMOUNT NUMBER {
 			if ($2 < 0 || $2 > INT_MAX) {
 				yyerror("invalid movemount");
@@ -316,6 +330,7 @@ lookup(char *s)
 		{ "fontname",		FONTNAME},
 		{ "gap",		GAP},
 		{ "groupborder",	GROUPBORDER},
+		{ "htile",		HTILE},
 		{ "ignore",		IGNORE},
 		{ "inactiveborder",	INACTIVEBORDER},
 		{ "menubg",		MENUBG},
@@ -329,6 +344,7 @@ lookup(char *s)
 		{ "unbind-mouse",	UNBINDMOUSE},
 		{ "ungroupborder",	UNGROUPBORDER},
 		{ "urgencyborder",	URGENCYBORDER},
+		{ "vtile",		VTILE},
 		{ "wm",			WM},
 		{ "yes",		YES}
 	};