refactor(hyprland): inline directional keybinds

This commit is contained in:
2026-10-11 12:26:27 -04:00
parent 2d39511a08
commit 14a6ea8ea6

View File

@@ -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