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.
This commit is contained in:
okan
2017-12-29 20:03:46 +00:00
parent 43db5b55ea
commit 6e7dbf5bb7
7 changed files with 109 additions and 39 deletions

13
parse.y
View File

@@ -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;