添加重启和退出快捷键
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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}},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user