feat: support keybind mode

This commit is contained in:
DreamMaoMao 2025-10-07 11:57:48 +08:00
parent 457534bd41
commit 91574fcaea
6 changed files with 64 additions and 3 deletions

View file

@ -22,6 +22,7 @@ void tagmon(const Arg *arg);
void spawn(const Arg *arg);
void spawn_shell(const Arg *arg);
void spawn_on_empty(const Arg *arg);
void setkeymode(const Arg *arg);
void setlayout(const Arg *arg);
void switch_layout(const Arg *arg);
void switch_keyboard_layout(const Arg *arg);

View file

@ -459,6 +459,17 @@ setlayout(const Arg *arg) {
}
}
void // 17
setkeymode(const Arg *arg) {
snprintf(keymode.mode, sizeof(keymode.mode), "%.27s", arg->v);
if (strcmp(keymode.mode, "default") == 0) {
keymode.isdefault = true;
} else {
keymode.isdefault = false;
}
printstatus();
}
void set_proportion(const Arg *arg) {
if (selmon->sel) {
unsigned int max_client_width =