refactor(hyprland): inline directional keybinds
This commit is contained in:
@@ -8,8 +8,41 @@
|
|||||||
options.modules.desktop.session.hyprland.enable = lib.mkEnableOption "the Hyprland compositor";
|
options.modules.desktop.session.hyprland.enable = lib.mkEnableOption "the Hyprland compositor";
|
||||||
|
|
||||||
config = lib.mkIf config.modules.desktop.session.hyprland.enable {
|
config = lib.mkIf config.modules.desktop.session.hyprland.enable {
|
||||||
registry.keybind.${config.networking.hostName} = lib.listToAttrs (
|
registry.keybind.${config.networking.hostName} = {
|
||||||
(map (workspace: {
|
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}";
|
name = "hyprland-workspace-${toString workspace}";
|
||||||
value = {
|
value = {
|
||||||
keys = "SUPER + ${toString workspace}";
|
keys = "SUPER + ${toString workspace}";
|
||||||
@@ -18,40 +51,7 @@
|
|||||||
inherit workspace;
|
inherit workspace;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}) (lib.range 1 9))
|
}) (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";
|
|
||||||
}
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
# This program integration owns the session, portals, and polkit, launched
|
# This program integration owns the session, portals, and polkit, launched
|
||||||
|
|||||||
Reference in New Issue
Block a user