mirror of
https://github.com/hyprwm/hyprland-wiki.git
synced 2024-11-26 06:25:59 +01:00
Simplify keybind generation code for workspaces
Change workspace keybind generation to use keycodes instead of numbers. This makes the code snippet work with different layouts. Removed redundant code.
This commit is contained in:
parent
d028652d78
commit
c8ce6fd9a9
1 changed files with 3 additions and 6 deletions
|
@ -137,13 +137,10 @@ module, or the flake-based Home Manager module.
|
||||||
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
|
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
|
||||||
builtins.concatLists (builtins.genList (
|
builtins.concatLists (builtins.genList (
|
||||||
x: let
|
x: let
|
||||||
ws = let
|
ws = builtins.toString (x + 10);
|
||||||
c = (x + 1) / 10;
|
|
||||||
in
|
|
||||||
builtins.toString (x + 1 - (c * 10));
|
|
||||||
in [
|
in [
|
||||||
"$mod, ${ws}, workspace, ${toString (x + 1)}"
|
"$mod, code:${ws}, workspace, ${toString (x + 1)}"
|
||||||
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
|
"$mod SHIFT, code:${ws}, movetoworkspace, ${toString (x + 1)}"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
10)
|
10)
|
||||||
|
|
Loading…
Reference in a new issue