♻️ refactor: split switch_layout into next_layout and previous_layout functions

- Add next_layout() to cycle forward through layouts
- Add previous_layout() to cycle backward through layouts
- Keep switch_layout() as backward-compatible alias to next_layout()
- Update config.conf with example keybinds for both new functions
This commit is contained in:
Eslam Mohamed Abdelghany 2026-03-02 15:01:57 +02:00
parent ad754167b7
commit caa8b05f38
4 changed files with 41 additions and 10 deletions

View file

@ -1021,6 +1021,10 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
} else if (strcmp(func_name, "setlayout") == 0) {
func = setlayout;
(*arg).v = strdup(arg_value);
} else if (strcmp(func_name, "next_layout") == 0) {
func = next_layout;
} else if (strcmp(func_name, "previous_layout") == 0) {
func = previous_layout;
} else if (strcmp(func_name, "switch_layout") == 0) {
func = switch_layout;
} else if (strcmp(func_name, "togglefloating") == 0) {