diff --git a/configs/nixos/modules/desktop/session/hyprland/default.nix b/configs/nixos/modules/desktop/session/hyprland/default.nix index c2f1362..61b0192 100644 --- a/configs/nixos/modules/desktop/session/hyprland/default.nix +++ b/configs/nixos/modules/desktop/session/hyprland/default.nix @@ -8,8 +8,41 @@ options.modules.desktop.session.hyprland.enable = lib.mkEnableOption "the Hyprland compositor"; config = lib.mkIf config.modules.desktop.session.hyprland.enable { - registry.keybind.${config.networking.hostName} = lib.listToAttrs ( - (map (workspace: { + registry.keybind.${config.networking.hostName} = { + hyprland-focus-left = { + keys = "SUPER + H"; + action = { + kind = "focus"; + direction = "left"; + }; + }; + + hyprland-focus-down = { + keys = "SUPER + J"; + action = { + kind = "focus"; + direction = "down"; + }; + }; + + hyprland-focus-up = { + keys = "SUPER + K"; + action = { + kind = "focus"; + direction = "up"; + }; + }; + + hyprland-focus-right = { + keys = "SUPER + L"; + action = { + kind = "focus"; + direction = "right"; + }; + }; + } + // lib.listToAttrs ( + map (workspace: { name = "hyprland-workspace-${toString workspace}"; value = { keys = "SUPER + ${toString workspace}"; @@ -18,40 +51,7 @@ inherit workspace; }; }; - }) (lib.range 1 9)) - ++ - map - ( - { direction, key }: - { - name = "hyprland-focus-${direction}"; - value = { - keys = "SUPER + ${key}"; - action = { - kind = "focus"; - inherit direction; - }; - }; - } - ) - [ - { - key = "H"; - direction = "left"; - } - { - key = "J"; - direction = "down"; - } - { - key = "K"; - direction = "up"; - } - { - key = "L"; - direction = "right"; - } - ] + }) (lib.range 1 9) ); # This program integration owns the session, portals, and polkit, launched