mirror of
https://github.com/labwc/labwc.git
synced 2025-11-07 13:30:06 -05:00
33 lines
800 B
C
33 lines
800 B
C
#include <strings.h>
|
|
|
|
#include "common/log.h"
|
|
#include "common/spawn.h"
|
|
#include "labwc.h"
|
|
|
|
static void
|
|
reconfigure(void)
|
|
{
|
|
char *const args[] = { "killall", "-SIGHUP", "labwc", NULL };
|
|
execvp(args[0], args);
|
|
}
|
|
|
|
void
|
|
action(struct server *server, const char *action, const char *command)
|
|
{
|
|
if (!action)
|
|
return;
|
|
if (!strcasecmp(action, "Exit")) {
|
|
wl_display_terminate(server->wl_display);
|
|
} else if (!strcasecmp(action, "Execute")) {
|
|
spawn_async_no_shell(command);
|
|
} else if (!strcasecmp(action, "NextWindow")) {
|
|
server->cycle_view =
|
|
desktop_next_view(server, server->cycle_view);
|
|
} else if (!strcasecmp(action, "Reconfigure")) {
|
|
reconfigure();
|
|
} else if (!strcasecmp(action, "debug-views")) {
|
|
dbg_show_views(server);
|
|
} else {
|
|
warn("action (%s) not supported", action);
|
|
}
|
|
}
|