Add a "restart wm" function. ok oga@

This commit is contained in:
ian
2007-11-28 16:35:52 +00:00
parent f14a3eeebf
commit 8b3cd2243a
5 changed files with 56 additions and 3 deletions

View File

@@ -263,6 +263,20 @@ kbfunc_exec(struct client_ctx *scratch, void *arg)
struct stat sb;
struct menu_q menuq;
struct menu *mi;
char *label;
int cmd = (int)arg;
switch(cmd) {
case CWM_EXEC_PROGRAM:
label = "exec";
break;
case CWM_EXEC_WM:
label = "wm";
break;
default:
err(1, "kbfunc_exec: invalid cmd %d", cmd);
/*NOTREACHED*/
}
if (getgroups(0, mygroups) == -1)
err(1, "getgroups failure");
@@ -320,8 +334,19 @@ kbfunc_exec(struct client_ctx *scratch, void *arg)
}
if ((mi = search_start(&menuq,
search_match_exec, NULL, NULL, "exec", 1)) != NULL)
u_spawn(mi->text);
search_match_exec, NULL, NULL, label, 1)) != NULL) {
switch (cmd) {
case CWM_EXEC_PROGRAM:
u_spawn(mi->text);
break;
case CWM_EXEC_WM:
exec_wm(mi->text);
break;
default:
err(1, "kb_func: egad, cmd changed value!");
break;
}
}
if (mi != NULL && mi->dummy)
xfree(mi);