home/hyprland: move everything except usbmaps to nix
Some checks are pending
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-07-19 11:36:35 -04:00
parent 692354b151
commit 11da0cb344

View file

@ -25,7 +25,7 @@ in {
windowRules windowRules
; ;
inherit (import ./scripts.nix {inherit config lib pkgs;}) clamshell idleD wallpaperD; inherit (import ./scripts.nix {inherit config lib pkgs;}) clamshell idleD tablet wallpaperD;
# Hyprland desktop utilities # Hyprland desktop utilities
hyprnome = lib.getExe pkgs.hyprnome; hyprnome = lib.getExe pkgs.hyprnome;
@ -45,32 +45,38 @@ in {
]; ];
}; };
bind = [ bind =
"${modifier} CONTROL, F12, exec, ${screenshot.region}" [
"${modifier} CONTROL, L, exec, ${defaultApps.lock}" "${modifier} CONTROL, F12, exec, ${screenshot.region}"
"${modifier} SHIFT, S, movetoworkspace, special:magic" "${modifier} CONTROL, L, exec, ${defaultApps.lock}"
"${modifier} SHIFT, V, togglefloating" "${modifier} SHIFT, S, movetoworkspace, special:magic"
"${modifier} SHIFT, W, fullscreen" "${modifier} SHIFT, V, togglefloating"
"${modifier} SHIFT, backslash, togglesplit" "${modifier} SHIFT, W, fullscreen"
"${modifier} SHIFT, comma, exec, ${hyprnome} --previous --move" "${modifier} SHIFT, backslash, togglesplit"
"${modifier} SHIFT, period, exec, ${hyprnome} --move" "${modifier} SHIFT, comma, exec, ${hyprnome} --previous --move"
"${modifier}, B, exec, ${defaultApps.browser}" "${modifier} SHIFT, period, exec, ${hyprnome} --move"
"${modifier}, C, killactive" "${modifier}, B, exec, ${defaultApps.browser}"
"${modifier}, E, exec, ${defaultApps.editor}" "${modifier}, C, killactive"
"${modifier}, F, exec, ${defaultApps.fileManager}" "${modifier}, E, exec, ${defaultApps.editor}"
"${modifier}, F11, exec, pkill -SIGUSR1 waybar" "${modifier}, F, exec, ${defaultApps.fileManager}"
"${modifier}, M, exec, ${defaultApps.logout}" "${modifier}, F11, exec, pkill -SIGUSR1 waybar"
"${modifier}, PRINT, exec, ${screenshot.region}" "${modifier}, M, exec, ${defaultApps.logout}"
"${modifier}, R, exec, ${defaultApps.launcher}" "${modifier}, PRINT, exec, ${screenshot.region}"
"${modifier}, S, togglespecialworkspace, magic" "${modifier}, R, exec, ${defaultApps.launcher}"
"${modifier}, T, exec, ${defaultApps.terminal}" "${modifier}, S, togglespecialworkspace, magic"
"${modifier}, comma, exec, ${hyprnome} --previous" "${modifier}, T, exec, ${defaultApps.terminal}"
"${modifier}, mouse_down, workspace, +1" "${modifier}, comma, exec, ${hyprnome} --previous"
"${modifier}, mouse_up, workspace, -1" "${modifier}, mouse_down, workspace, +1"
"${modifier}, period, exec, ${hyprnome}" "${modifier}, mouse_up, workspace, -1"
", PRINT, exec, ${screenshot.screen}" "${modifier}, period, exec, ${hyprnome}"
"CONTROL, F12, exec, ${screenshot.screen}" ", PRINT, exec, ${screenshot.screen}"
]; "CONTROL, F12, exec, ${screenshot.screen}"
]
++ builtins.map (x: "${modifier}, ${toString x}, workspace, ${toString x}") defaultWorkspaces
++ builtins.map (x: "${modifier} SHIFT, ${toString x}, movetoworkspace, ${toString x}") defaultWorkspaces
++ lib.attrsets.mapAttrsToList (key: direction: "${modifier}, ${key}, movefocus, ${direction}") windowManagerBinds
++ lib.attrsets.mapAttrsToList (key: direction: "${modifier} SHIFT, ${key}, movewindow, ${direction}") windowManagerBinds
++ lib.attrsets.mapAttrsToList (key: direction: "${modifier} CONTROL SHIFT, ${key}, movecurrentworkspacetomonitor, ${direction}") windowManagerBinds;
bindm = [ bindm = [
# Move/resize windows with mainMod + LMB/RMB and dragging # Move/resize windows with mainMod + LMB/RMB and dragging
@ -87,6 +93,7 @@ in {
", xf86audioprev, exec, ${media.prev}" ", xf86audioprev, exec, ${media.prev}"
", xf86audionext, exec, ${media.next}" ", xf86audionext, exec, ${media.next}"
] ]
++ builtins.map (switch: ",switch:${switch},exec,${tablet}") cfg.desktop.hyprland.tabletMode.tabletSwitches
++ lib.lists.optionals (cfg.desktop.hyprland.laptopMonitors != []) ++ lib.lists.optionals (cfg.desktop.hyprland.laptopMonitors != [])
[ [
",switch:on:Lid Switch,exec,${clamshell} on" ",switch:on:Lid Switch,exec,${clamshell} on"
@ -182,7 +189,11 @@ in {
vfr = true; vfr = true;
}; };
monitor = ",preferred,auto,auto"; monitor =
[",preferred,auto,auto"]
++ cfg.desktop.hyprland.laptopMonitors
++ cfg.desktop.hyprland.monitors;
windowrulev2 = windowRules; windowrulev2 = windowRules;
xwayland.force_zero_scaling = true; xwayland.force_zero_scaling = true;
}; };
@ -195,51 +206,9 @@ in {
windowManagerBinds windowManagerBinds
; ;
inherit (import ./scripts.nix {inherit config lib pkgs;}) tablet;
# Hyprland desktop utilities # Hyprland desktop utilities
hyprnome = lib.getExe pkgs.hyprnome; hyprnome = lib.getExe pkgs.hyprnome;
in '' in ''
${
lib.strings.concatMapStringsSep "\n"
(monitor: ''monitor = ${monitor}'')
(cfg.desktop.hyprland.laptopMonitors
++ cfg.desktop.hyprland.monitors)
}
# Enable virtual keyboard in tablet mode
${
lib.strings.concatMapStringsSep "\n"
(switch: ''bindl = ,switch:${switch},exec,${tablet}'')
cfg.desktop.hyprland.tabletMode.tabletSwitches
}
# Move focus with mainMod + keys ++
# Move window with mainMod SHIFT + keys ++
# Move workspace to another output with mainMod CONTROL SHIFT + keys.
${
lib.strings.concatLines
(
lib.attrsets.mapAttrsToList (key: direction: ''
bind = ${modifier}, ${key}, movefocus, ${direction}
bind = ${modifier} SHIFT, ${key}, movewindow, ${direction}
bind = ${modifier} CONTROL SHIFT, ${key}, movecurrentworkspacetomonitor, ${direction}
'')
windowManagerBinds
)
}
# Switch workspaces with mainMod + [1-9] ++
# Move active window to a workspace with mainMod + SHIFT + [1-9].
${
lib.strings.concatMapStringsSep "\n"
(x: ''
bind = ${modifier}, ${toString x}, workspace, ${toString x}
bind = ${modifier} SHIFT, ${toString x}, movetoworkspace, ${toString x}
'')
defaultWorkspaces
}
bind=CTRL ALT,R,submap,resize bind=CTRL ALT,R,submap,resize
submap=resize submap=resize
binde=,down,resizeactive,0 10 binde=,down,resizeactive,0 10