struct wlr_box deco_box(struct view *view, enum deco_part deco_part);
enum deco_part deco_at(struct view *view, double lx, double ly);
-void action(struct server *server, struct keybind *keybind);
+void action(struct server *server, const char *action, const char *command);
void dbg_show_one_view(struct view *view);
void dbg_show_views(struct server *server);
#include <strings.h>
-void action(struct server *server, struct keybind *keybind)
+void action(struct server *server, const char *action, const char *command)
{
- if (!keybind || !keybind->action)
+ if (!action)
return;
- if (!strcasecmp(keybind->action, "Exit")) {
+ if (!strcasecmp(action, "Exit")) {
wl_display_terminate(server->wl_display);
- } else if (!strcasecmp(keybind->action, "NextWindow")) {
+ } else if (!strcasecmp(action, "NextWindow")) {
server->cycle_view =
desktop_next_view(server, server->cycle_view);
- } else if (!strcasecmp(keybind->action, "Execute")) {
- spawn_async_no_shell(keybind->command);
- } else if (!strcasecmp(keybind->action, "debug-views")) {
+ } else if (!strcasecmp(action, "Execute")) {
+ spawn_async_no_shell(command);
+ } else if (!strcasecmp(action, "debug-views")) {
dbg_show_views(server);
} else {
- warn("action (%s) not supported", keybind->action);
+ warn("action (%s) not supported", action);
}
}
continue;
for (size_t i = 0; i < keybind->keysyms_len; i++) {
if (sym == keybind->keysyms[i]) {
- action(server, keybind);
+ action(server, keybind->action, keybind->command);
return true;
}
}