diff options
| -rw-r--r-- | hosts/gheshki/home.nix | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/hosts/gheshki/home.nix b/hosts/gheshki/home.nix index 6c9e458..e180f9d 100644 --- a/hosts/gheshki/home.nix +++ b/hosts/gheshki/home.nix @@ -66,29 +66,25 @@ "${mod}+Shift+r" = "restart"; "${mod}+Shift+e" = "exec i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"; - - "${mod}+1" = "workspace number 1"; - "${mod}+2" = "workspace number 2"; - "${mod}+3" = "workspace number 3"; - "${mod}+4" = "workspace number 4"; - "${mod}+5" = "workspace number 5"; - "${mod}+6" = "workspace number 6"; - "${mod}+7" = "workspace number 7"; - "${mod}+8" = "workspace number 8"; - "${mod}+9" = "workspace number 9"; - "${mod}+0" = "workspace number 10"; - - "${mod}+Shift+1" = "move container to workspace 1"; - "${mod}+Shift+2" = "move container to workspace 2"; - "${mod}+Shift+3" = "move container to workspace 3"; - "${mod}+Shift+4" = "move container to workspace 4"; - "${mod}+Shift+5" = "move container to workspace 5"; - "${mod}+Shift+6" = "move container to workspace 6"; - "${mod}+Shift+7" = "move container to workspace 7"; - "${mod}+Shift+8" = "move container to workspace 8"; - "${mod}+Shift+9" = "move container to workspace 9"; - "${mod}+Shift+0" = "move container to workspace 10"; - }; + } + // lib.listToAttrs ( + builtins.concatMap ( + i: + let + key = if i == 10 then "0" else toString i; + in + [ + { + name = "${mod}+${key}"; + value = "workspace number ${toString i}"; + } + { + name = "${mod}+Shift+${key}"; + value = "move container to workspace number ${toString i}"; + } + ] + ) (lib.range 1 10) + ); startup = [ { |
