diff --git a/src/action.c b/src/action.c index eb4f92d..fa2da2b 100644 --- a/src/action.c +++ b/src/action.c @@ -16,3 +16,12 @@ void spawn(const user_action_arg_t *arg) { g_spawn_command_line_async((const char *)arg->ptr, nullptr); } + +void quit(const user_action_arg_t *arg) { + const bool restart = arg->b; + if (restart) { + wm_restart(); + } else { + wm_quit(); + } +} diff --git a/src/action.h b/src/action.h index f0f472a..374a30e 100644 --- a/src/action.h +++ b/src/action.h @@ -50,3 +50,4 @@ typedef struct keyboard_t { void select_tag_of_current_monitor(const user_action_arg_t *arg); void spawn(const user_action_arg_t *arg); +void quit(const user_action_arg_t *arg); diff --git a/src/default_config.h b/src/default_config.h index 9b25158..0533e5e 100644 --- a/src/default_config.h +++ b/src/default_config.h @@ -28,5 +28,7 @@ static const button_t button_list[] = { static const char launcher[] = "rofi -show combi -modes window,drun,run,ssh,combi,windowcd"; static const keyboard_t key_list[] = { - {modifier_super, XK_p, spawn, {.ptr = launcher}}, + {modifier_alt, XK_p, spawn, {.ptr = launcher}}, + {modifier_alt, XK_q, quit, {.b = false}}, + {modifier_alt, XK_r, quit, {.b = true}}, };