aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authorokan2017-12-29 20:03:46 +0000
committerokan2017-12-29 20:03:46 +0000
commit9c7e3d61414a846c6b85d62f76177a30a255423a (patch)
treeaa15f6cb2dfac7e58c47e964f980385218b2ead3 /parse.y
parent94fa8f6008663944358afaeb58a1217cf564a95c (diff)
downloadcwm-9c7e3d61414a846c6b85d62f76177a30a255423a.tar.gz
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. No objections and seems sensible to sthen.
Diffstat (limited to '')
-rw-r--r--parse.y15
1 files changed, 13 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index e7eaf18..b8a72cb 100644
--- a/parse.y
+++ b/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.68 2017/04/26 21:10:54 okan Exp $ */
+/* $OpenBSD: parse.y,v 1.69 2017/12/29 20:03:46 okan Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -70,7 +70,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
@@ -146,6 +146,16 @@ main : FONTNAME STRING {
free($2);
free($3);
}
+ | WM STRING string {
+ if (!conf_wm_add(conf, $2, $3)) {
+ yyerror("wm name/path too long");
+ free($2);
+ free($3);
+ YYERROR;
+ }
+ free($2);
+ free($3);
+ }
| AUTOGROUP NUMBER STRING {
if ($2 < 0 || $2 > 9) {
yyerror("invalid autogroup");
@@ -317,6 +327,7 @@ lookup(char *s)
{ "unbind-mouse", UNBINDMOUSE},
{ "ungroupborder", UNGROUPBORDER},
{ "urgencyborder", URGENCYBORDER},
+ { "wm", WM},
{ "yes", YES}
};
const struct keywords *p;