home/desktop: merge hyprland and sway windowManagerBinds
Some checks are pending
git-mirror / gitlab-sync (push) Waiting to run
nix-build / default-build (push) Waiting to run
nix-build / fallarbor-build (push) Waiting to run
nix-build / lavaridge-build (push) Waiting to run
nix-build / mauville-build (push) Waiting to run
nix-build / petalburg-build (push) Waiting to run
nix-build / rustboro-build (push) Waiting to run
nix-check / fmt-check (push) Waiting to run
nix-check / eval-check (push) Waiting to run

This commit is contained in:
Aly Raffauf 2024-08-03 23:13:09 -04:00
parent 74b97332f4
commit 5b8e60d78e
4 changed files with 24 additions and 37 deletions

View file

@ -14,15 +14,15 @@ in {
extraConfig = let
moveMonitorBinds =
lib.attrsets.mapAttrsToList (
key: direction: "bind=CONTROL,${key},movecurrentworkspacetomonitor,${direction}"
key: direction: "bind=CONTROL,${key},movecurrentworkspacetomonitor,${builtins.substring 0 1 direction}"
)
cfg.desktop.hyprland.windowManagerBinds;
cfg.desktop.windowManagerBinds;
moveWindowBinds =
lib.attrsets.mapAttrsToList (
key: direction: "bind=,${key},movewindow,${direction}"
key: direction: "bind=,${key},movewindow,${builtins.substring 0 1 direction}"
)
cfg.desktop.hyprland.windowManagerBinds;
cfg.desktop.windowManagerBinds;
moveWorkspaceBinds = builtins.map (x: "bind=,${toString x},workspace,${toString x}") [1 2 3 4 5 6 7 8 9];
in ''

View file

@ -56,9 +56,9 @@ in {
]
++ builtins.map (x: "$mod SHIFT,${toString x},movetoworkspace,${toString x}") [1 2 3 4 5 6 7 8 9]
++ builtins.map (x: "$mod,${toString x},workspace,${toString x}") [1 2 3 4 5 6 7 8 9]
++ lib.attrsets.mapAttrsToList (key: direction: "$mod CONTROL SHIFT,${key},movecurrentworkspacetomonitor,${direction}") cfg.desktop.hyprland.windowManagerBinds
++ lib.attrsets.mapAttrsToList (key: direction: "$mod SHIFT,${key},movewindow,${direction}") cfg.desktop.hyprland.windowManagerBinds
++ lib.attrsets.mapAttrsToList (key: direction: "$mod,${key},movefocus,${direction}") cfg.desktop.hyprland.windowManagerBinds;
++ lib.attrsets.mapAttrsToList (key: direction: "$mod CONTROL SHIFT,${key},movecurrentworkspacetomonitor,${builtins.substring 0 1 direction}") cfg.desktop.windowManagerBinds
++ lib.attrsets.mapAttrsToList (key: direction: "$mod SHIFT,${key},movewindow,${builtins.substring 0 1 direction}") cfg.desktop.windowManagerBinds
++ lib.attrsets.mapAttrsToList (key: direction: "$mod,${key},movefocus,${builtins.substring 0 1 direction}") cfg.desktop.windowManagerBinds;
bindm = [
# Move/resize windows with mainMod + LMB/RMB and dragging

View file

@ -124,7 +124,7 @@ in {
"${modifier}+Shift+${key}" = "move ${direction}";
"${modifier}+Control+Shift+${key}" = "move workspace to output ${direction}";
})
cfg.desktop.sway.windowManagerBinds;
cfg.desktop.windowManagerBinds;
modes = {
move =
@ -144,7 +144,7 @@ in {
)
// lib.attrsets.concatMapAttrs
(key: direction: {"${key}" = "move ${direction}";})
cfg.desktop.sway.windowManagerBinds;
cfg.desktop.windowManagerBinds;
resize = {
Escape = "mode default";

View file

@ -131,21 +131,6 @@ in {
type = lib.types.listOf lib.types.str;
};
windowManagerBinds = lib.mkOption {
description = "Default binds for window management.";
default = {
down = "d";
left = "l";
right = "r";
up = "u";
h = "l";
j = "d";
k = "u";
l = "r";
};
type = lib.types.attrs;
};
tabletMode = {
enable = lib.mkEnableOption "Tablet mode for hyprland.";
@ -163,21 +148,23 @@ in {
default = osConfig.ar.desktop.sway.enable;
type = lib.types.bool;
};
};
windowManagerBinds = lib.mkOption {
description = "Default binds for window management.";
default = {
Down = "down";
Left = "left";
Right = "right";
Up = "up";
H = "left";
J = "down";
K = "up";
L = "right";
};
type = lib.types.attrs;
windowManagerBinds = lib.mkOption {
description = "Default binds for window management.";
default = {
Down = "down";
Left = "left";
Right = "right";
Up = "up";
H = "left";
J = "down";
K = "up";
L = "right";
};
type = lib.types.attrs;
};
};