diff --git a/src/config/parse_config.h b/src/config/parse_config.h index d2d7cf83..4c9ebc27 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -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; diff --git a/src/dispatch/bind_declare.h b/src/dispatch/bind_declare.h index fcfb9520..d0b3e538 100644 --- a/src/dispatch/bind_declare.h +++ b/src/dispatch/bind_declare.h @@ -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); diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index e051da0c..e1f12fc7 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -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"};