about summary refs log tree commit diff
path: root/parse.y
diff options
context:
space:
mode:
authorokan <okan>2018-02-06 15:05:20 +0000
committerokan <okan>2018-02-06 15:05:20 +0000
commit63ebc0cd8b65300104929d3463fed431996f4374 (patch)
treef547800ff23c62896ad849d2148ec7adf3f08f0d /parse.y
parenta0774f4777a4a94ea4bbc867c16cde3167075f80 (diff)
parentf3211427c16b755db20bc71ce4074e9fb9aae8af (diff)
downloadcwm-63ebc0cd8b65300104929d3463fed431996f4374.tar.gz
cwm-63ebc0cd8b65300104929d3463fed431996f4374.tar.xz
cwm-63ebc0cd8b65300104929d3463fed431996f4374.zip
cvsimport
* refs/heads/master: (28 commits)
  Use screen's saved view instead of re-querying the server.
  Slightly expand and expose verbose debugging.
  add debugging for x events
  Add a simple debug logging mechanism.
  Simplification; use asprintf where appropriate now.
  Use func attributes where appropriate.
  Fix wins comparison declaration since it's unsigned from XQueryTree().
  Generate name_to_func[] in a clean and readable fashion.
  Shrink tier[] by one after removing matchname in r1.55.
  If the requested group number is invalid, bail but don't kill cwm.
  Quick fix: exit after a failed execvp in u_spawn instead; previously we did in u_exec, but the introduction of re-exec'ing the previous invocation of cwm if 'exec_wm' failed missed the 'exec' failing path. Will likely split out as a proper fix.
  Only exec the fallback when in CWM_EXEC_WM state.
  Typo, from Julien Steinhauser.
  Convert menu-exec-wm from an abritrary exec menu, into a config-based menu from which one may configure (wm <name> <path_and_args>) (and choose) specific window managers to replace the running one. 'wm cwm cwm' is included by default.
  As done for buttonrelease, work specific un-cycling and un-highlighting actions into the keyrelease event, only performing what's actually needed for each; should result in much fewer events against keyreleases. No intended behaviour change.
  Merge group_toggle_membership_leave into the buttonrelease event and only do border work for a group/ungroup action.
  add helper function client_show to bring together like actions for unhide/raise
  Add support for re-exec'ing with SIGHUP; equivalent to the already built-in 'restart' function.
  Use poll and XNextEvent to replace XNextEvent blocking inside the x11 event handler.
  zap stray that snuck in
  ...
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y19
1 files changed, 16 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index ba99e0a..1db92c0 100644
--- a/parse.y
+++ b/parse.y
@@ -72,7 +72,7 @@ typedef struct {
 
 %token	BINDKEY UNBINDKEY BINDMOUSE UNBINDMOUSE
 %token	FONTNAME STICKY GAP
-%token	AUTOGROUP COMMAND IGNORE
+%token	AUTOGROUP COMMAND IGNORE WM
 %token	YES NO BORDERWIDTH MOVEAMOUNT
 %token	COLOR SNAPDIST
 %token	ACTIVEBORDER INACTIVEBORDER URGENCYBORDER
@@ -139,12 +139,24 @@ main		: FONTNAME STRING		{
 			conf->snapdist = $2;
 		}
 		| COMMAND STRING string		{
-			if (!conf_cmd_add(conf, $2, $3)) {
-				yyerror("command name/path too long");
+			if (strlen($3) >= PATH_MAX) {
+				yyerror("%s command path too long", $2);
 				free($2);
 				free($3);
 				YYERROR;
 			}
+			conf_cmd_add(conf, $2, $3);
+			free($2);
+			free($3);
+		}
+		| WM STRING string	{
+			if (strlen($3) >= PATH_MAX) {
+				yyerror("%s wm path too long", $2);
+				free($2);
+				free($3);
+				YYERROR;
+			}
+			conf_wm_add(conf, $2, $3);
 			free($2);
 			free($3);
 		}
@@ -319,6 +331,7 @@ lookup(char *s)
 		{ "unbind-mouse",	UNBINDMOUSE},
 		{ "ungroupborder",	UNGROUPBORDER},
 		{ "urgencyborder",	URGENCYBORDER},
+		{ "wm",			WM},
 		{ "yes",		YES}
 	};
 	const struct keywords	*p;