From 3746d2fa67775bfd103fcaeeed1ece6c9fac4999 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Thu, 29 Aug 2024 21:00:18 +0200 Subject: [PATCH] Nix/Hyprland on HM: fix nix loop for workspaces (#764) --- pages/Nix/Hyprland on Home Manager.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pages/Nix/Hyprland on Home Manager.md b/pages/Nix/Hyprland on Home Manager.md index 552f9a3..46ed50a 100644 --- a/pages/Nix/Hyprland on Home Manager.md +++ b/pages/Nix/Hyprland on Home Manager.md @@ -141,19 +141,15 @@ Here is an example config: ] ++ ( # workspaces - # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} - builtins.concatLists (builtins.genList ( - x: let - ws = let - c = (x + 1) / 10; - in - builtins.toString (x + 1 - (c * 10)); + # binds $mod + [shift +] {1..9} to [move to] workspace {1..9} + builtins.concatLists (builtins.genList (i: + let ws = i + 1; in [ - "$mod, ${ws}, workspace, ${toString (x + 1)}" - "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" + "$mod, code:1${toString i}, workspace, ${toString ws}" + "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}" ] ) - 10) + 9) ); }; }