nixcfg/homeManagerModules/desktop/hyprland/default.nix

61 lines
1.6 KiB
Nix
Raw Normal View History

2024-04-07 22:16:33 -04:00
{
config,
lib,
pkgs,
2024-04-07 22:16:33 -04:00
...
2024-07-09 23:40:10 -04:00
}: let
cfg = config.ar.home;
in {
config = lib.mkIf cfg.desktop.hyprland.enable {
wayland.windowManager.hyprland = {
enable = true;
2024-07-09 23:40:10 -04:00
settings =
import ./vars.nix {inherit config lib pkgs;};
2024-07-19 10:50:27 -04:00
extraConfig = let
inherit (import ./helpers.nix {inherit config lib pkgs;}) defaultWorkspaces windowManagerBinds;
in ''
submap=resize
binde=,down,resizeactive,0 10
binde=,left,resizeactive,-10 0
binde=,right,resizeactive,10 0
binde=,up,resizeactive,0 -10
binde=,j,resizeactive,0 10
binde=,h,resizeactive,-10 0
binde=,l,resizeactive,10 0
binde=,k,resizeactive,0 -10
bind=,escape,submap,reset
submap=reset
submap=move
# Move window with keys ++
# Move workspaces across monitors with CONTROL + keys.
${
lib.strings.concatLines
(
lib.attrsets.mapAttrsToList (key: direction: ''
bind = , ${key}, movewindow, ${direction}
bind = CONTROL, ${key}, movecurrentworkspacetomonitor, ${direction}
'')
windowManagerBinds
)
}
# Move active window to a workspace with [1-9]
${
lib.strings.concatMapStringsSep "\n"
(x: "bind = , ${toString x}, movetoworkspace, ${toString x}")
defaultWorkspaces
}
# hyprnome
bind = , comma, exec, ${lib.getExe pkgs.hyprnome} --previous --move
bind = , period, exec, ${lib.getExe pkgs.hyprnome} --move
bind=,escape,submap,reset
submap=reset
'';
};
2024-07-09 23:40:10 -04:00
};
}