2020-06-18 20:18:01 +01:00
|
|
|
#include "labwc.h"
|
2020-08-03 20:56:38 +01:00
|
|
|
#include "common/spawn.h"
|
2020-08-12 19:37:44 +01:00
|
|
|
#include "common/log.h"
|
2020-06-18 20:18:01 +01:00
|
|
|
|
|
|
|
|
#include <strings.h>
|
|
|
|
|
|
|
|
|
|
void action(struct server *server, struct keybind *keybind)
|
|
|
|
|
{
|
|
|
|
|
if (!keybind || !keybind->action)
|
|
|
|
|
return;
|
|
|
|
|
if (!strcasecmp(keybind->action, "Exit")) {
|
|
|
|
|
wl_display_terminate(server->wl_display);
|
|
|
|
|
} else if (!strcasecmp(keybind->action, "NextWindow")) {
|
2020-09-08 20:18:12 +01:00
|
|
|
server->cycle_view = view_next(server, server->cycle_view);
|
2020-06-18 20:18:01 +01:00
|
|
|
} else if (!strcasecmp(keybind->action, "Execute")) {
|
2020-06-19 22:00:22 +01:00
|
|
|
spawn_async_no_shell(keybind->command);
|
2020-06-18 20:18:01 +01:00
|
|
|
} else if (!strcasecmp(keybind->action, "debug-views")) {
|
|
|
|
|
dbg_show_views(server);
|
|
|
|
|
} else {
|
2020-08-12 19:37:44 +01:00
|
|
|
warn("action (%s) not supported", keybind->action);
|
2020-06-18 20:18:01 +01:00
|
|
|
}
|
|
|
|
|
}
|