mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-23 05:35:53 -04:00
Adds killclient_byappid to internal commands
This commit is contained in:
parent
f3336eae68
commit
df1d622649
3 changed files with 20 additions and 1 deletions
|
|
@ -989,7 +989,10 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
|
|||
(*arg).i = atoi(arg_value);
|
||||
} else if (strcmp(func_name, "killclient") == 0) {
|
||||
func = killclient;
|
||||
} else if (strcmp(func_name, "centerwin") == 0) {
|
||||
} else if (strcmp(func_name, "killclient_byappid") == 0) {
|
||||
func = killclient_byappid;
|
||||
(*arg).v = strdup(arg_value);
|
||||
} else if (strcmp(func_name, "centerwin") == 0) {
|
||||
func = centerwin;
|
||||
} else if (strcmp(func_name, "focuslast") == 0) {
|
||||
func = focuslast;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ int32_t exchange_client(const Arg *arg);
|
|||
int32_t exchange_stack_client(const Arg *arg);
|
||||
int32_t exchange_stack_client_bounded(const Arg *arg);
|
||||
int32_t killclient(const Arg *arg);
|
||||
int32_t killclient_byappid(const Arg *arg);
|
||||
int32_t toggleglobal(const Arg *arg);
|
||||
int32_t incnmaster(const Arg *arg);
|
||||
int32_t focusmon(const Arg *arg);
|
||||
|
|
|
|||
|
|
@ -409,6 +409,21 @@ int32_t killclient(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int32_t killclient_byappid(const Arg *arg) {
|
||||
Client *c = NULL;
|
||||
/* No Arg? No Kill. */
|
||||
if (!arg || !arg->v)
|
||||
return 0;
|
||||
/* for some reason its warning me about this indent? */
|
||||
|
||||
wl_list_for_each(c, &clients, link) {
|
||||
if (strcmp((*arg).v, client_get_appid(c)) == 0) {
|
||||
pending_kill_client(c);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t moveresize(const Arg *arg) {
|
||||
const char *cursors[] = {"nw-resize", "ne-resize", "sw-resize",
|
||||
"se-resize"};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue