添加重启和退出快捷键

This commit is contained in:
zedhugh committed 2025-11-25 06:06:58 +08:00
1 parent b45eea11fa
commit a26a903a19
3 files changed
+13 -1

No files matched your search

+9
View File
@@ -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();
}
}
+1
View File
@@ -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);
+3 -1
View File
@@ -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}},
};