2024-04-07 22:16:33 -04:00
|
|
|
{
|
|
|
|
config,
|
2024-07-07 01:36:41 -04:00
|
|
|
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-19 10:50:27 -04:00
|
|
|
hyprland.settings = let
|
2024-07-07 01:36:41 -04:00
|
|
|
inherit
|
2024-07-19 09:58:45 -04:00
|
|
|
(import ./vars.nix {inherit config lib pkgs;})
|
|
|
|
brightness
|
|
|
|
defaultApps
|
2024-07-07 01:36:41 -04:00
|
|
|
defaultWorkspaces
|
|
|
|
layerRules
|
2024-07-19 09:58:45 -04:00
|
|
|
media
|
2024-07-07 01:36:41 -04:00
|
|
|
modifier
|
2024-07-19 09:58:45 -04:00
|
|
|
screenshot
|
|
|
|
volume
|
2024-07-07 01:36:41 -04:00
|
|
|
windowManagerBinds
|
|
|
|
windowRules
|
|
|
|
;
|
2024-07-19 10:50:27 -04:00
|
|
|
|
2024-07-19 11:36:35 -04:00
|
|
|
inherit (import ./scripts.nix {inherit config lib pkgs;}) clamshell idleD tablet wallpaperD;
|
2024-07-07 01:36:41 -04:00
|
|
|
|
|
|
|
# Hyprland desktop utilities
|
|
|
|
hyprnome = lib.getExe pkgs.hyprnome;
|
2024-07-19 10:50:27 -04:00
|
|
|
in {
|
|
|
|
animations = {
|
|
|
|
enabled = true;
|
|
|
|
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
|
|
|
|
|
|
|
|
animation = [
|
|
|
|
"border, 1, 10, default"
|
|
|
|
"borderangle, 1, 8, default"
|
|
|
|
"fade, 1, 7, default"
|
|
|
|
"specialWorkspace, 1, 6, default, slidevert"
|
|
|
|
"windows, 1, 7, myBezier"
|
|
|
|
"windowsOut, 1, 7, default, popin 80%"
|
|
|
|
"workspaces, 1, 6, default"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-07-19 11:36:35 -04:00
|
|
|
bind =
|
|
|
|
[
|
|
|
|
"${modifier} CONTROL, F12, exec, ${screenshot.region}"
|
|
|
|
"${modifier} CONTROL, L, exec, ${defaultApps.lock}"
|
|
|
|
"${modifier} SHIFT, S, movetoworkspace, special:magic"
|
|
|
|
"${modifier} SHIFT, V, togglefloating"
|
|
|
|
"${modifier} SHIFT, W, fullscreen"
|
|
|
|
"${modifier} SHIFT, backslash, togglesplit"
|
|
|
|
"${modifier} SHIFT, comma, exec, ${hyprnome} --previous --move"
|
|
|
|
"${modifier} SHIFT, period, exec, ${hyprnome} --move"
|
|
|
|
"${modifier}, B, exec, ${defaultApps.browser}"
|
|
|
|
"${modifier}, C, killactive"
|
|
|
|
"${modifier}, E, exec, ${defaultApps.editor}"
|
|
|
|
"${modifier}, F, exec, ${defaultApps.fileManager}"
|
|
|
|
"${modifier}, F11, exec, pkill -SIGUSR1 waybar"
|
|
|
|
"${modifier}, M, exec, ${defaultApps.logout}"
|
|
|
|
"${modifier}, PRINT, exec, ${screenshot.region}"
|
|
|
|
"${modifier}, R, exec, ${defaultApps.launcher}"
|
|
|
|
"${modifier}, S, togglespecialworkspace, magic"
|
|
|
|
"${modifier}, T, exec, ${defaultApps.terminal}"
|
|
|
|
"${modifier}, comma, exec, ${hyprnome} --previous"
|
|
|
|
"${modifier}, mouse_down, workspace, +1"
|
|
|
|
"${modifier}, mouse_up, workspace, -1"
|
|
|
|
"${modifier}, period, exec, ${hyprnome}"
|
|
|
|
", 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;
|
2024-07-19 10:50:27 -04:00
|
|
|
|
|
|
|
bindm = [
|
|
|
|
# Move/resize windows with mainMod + LMB/RMB and dragging
|
|
|
|
"${modifier}, mouse:272, movewindow"
|
|
|
|
"${modifier}, mouse:273, resizewindow"
|
|
|
|
];
|
|
|
|
|
|
|
|
bindl =
|
|
|
|
[
|
|
|
|
# Volume, microphone, and media keys.
|
|
|
|
", xf86audiomute, exec, ${volume.mute}"
|
|
|
|
", xf86audiomicmute, exec, ${volume.micMute}"
|
|
|
|
", xf86audioplay, exec, ${media.play}"
|
|
|
|
", xf86audioprev, exec, ${media.prev}"
|
|
|
|
", xf86audionext, exec, ${media.next}"
|
|
|
|
]
|
2024-07-19 11:36:35 -04:00
|
|
|
++ builtins.map (switch: ",switch:${switch},exec,${tablet}") cfg.desktop.hyprland.tabletMode.tabletSwitches
|
2024-07-19 11:10:34 -04:00
|
|
|
++ lib.lists.optionals (cfg.desktop.hyprland.laptopMonitors != [])
|
|
|
|
[
|
|
|
|
",switch:on:Lid Switch,exec,${clamshell} on"
|
|
|
|
",switch:off:Lid Switch,exec,${clamshell} off"
|
|
|
|
];
|
2024-07-19 10:50:27 -04:00
|
|
|
|
|
|
|
bindle = [
|
|
|
|
# Display, volume, microphone, and media keys.
|
|
|
|
", xf86monbrightnessup, exec, ${brightness.up}"
|
|
|
|
", xf86monbrightnessdown, exec, ${brightness.down}"
|
|
|
|
", xf86audioraisevolume, exec, ${volume.up}"
|
|
|
|
", xf86audiolowervolume, exec, ${volume.down}"
|
|
|
|
];
|
|
|
|
|
2024-07-19 11:10:34 -04:00
|
|
|
decoration = {
|
|
|
|
blur = {
|
|
|
|
enabled = true;
|
|
|
|
passes = 1;
|
|
|
|
size = 8;
|
|
|
|
};
|
|
|
|
|
|
|
|
"col.shadow" = "rgba(${lib.strings.removePrefix "#" cfg.theme.colors.shadow}EE)";
|
|
|
|
dim_special = 0.5;
|
|
|
|
drop_shadow = true;
|
|
|
|
layerrule = layerRules;
|
|
|
|
rounding = 10;
|
|
|
|
shadow_range = 4;
|
|
|
|
shadow_render_power = 3;
|
2024-07-19 10:50:27 -04:00
|
|
|
};
|
|
|
|
|
2024-07-19 11:10:34 -04:00
|
|
|
dwindle.preserve_split = true;
|
|
|
|
|
|
|
|
env = [
|
|
|
|
"QT_QPA_PLATFORMTHEME,qt6ct"
|
|
|
|
"XCURSOR_SIZE,${toString config.home.pointerCursor.size}"
|
|
|
|
];
|
|
|
|
|
2024-07-19 10:50:27 -04:00
|
|
|
exec-once =
|
2024-07-07 01:36:41 -04:00
|
|
|
[
|
2024-07-19 09:58:45 -04:00
|
|
|
wallpaperD
|
2024-07-07 01:36:41 -04:00
|
|
|
(lib.getExe pkgs.waybar)
|
2024-07-19 09:58:45 -04:00
|
|
|
idleD
|
2024-07-08 14:22:58 -04:00
|
|
|
(lib.getExe pkgs.wayland-pipewire-idle-inhibit)
|
2024-07-07 01:36:41 -04:00
|
|
|
(lib.getExe' pkgs.blueman "blueman-applet")
|
|
|
|
(lib.getExe' pkgs.networkmanagerapplet "nm-applet")
|
|
|
|
(lib.getExe' pkgs.playerctl "playerctld")
|
|
|
|
(lib.getExe' pkgs.swayosd "swayosd-server")
|
|
|
|
(lib.getExe pkgs.mako)
|
|
|
|
"${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1"
|
|
|
|
]
|
|
|
|
++ lib.lists.optional (cfg.desktop.hyprland.redShift)
|
|
|
|
"${lib.getExe pkgs.gammastep} -l 33.74:-84.38";
|
2024-07-19 10:50:27 -04:00
|
|
|
|
|
|
|
input = {
|
2024-07-19 11:10:34 -04:00
|
|
|
follow_mouse = 1;
|
2024-07-19 10:50:27 -04:00
|
|
|
kb_layout = "us";
|
|
|
|
kb_variant = "altgr-intl";
|
|
|
|
sensitivity = 0; # -1.0 to 1.0, 0 means no modification.
|
2024-07-19 11:12:15 -04:00
|
|
|
|
2024-07-19 10:50:27 -04:00
|
|
|
touchpad = {
|
|
|
|
clickfinger_behavior = true;
|
|
|
|
drag_lock = true;
|
|
|
|
middle_button_emulation = true;
|
|
|
|
natural_scroll = true;
|
|
|
|
tap-to-click = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
general = {
|
|
|
|
"col.active_border" = "rgba(${lib.strings.removePrefix "#" cfg.theme.colors.secondary}EE) rgba(${lib.strings.removePrefix "#" cfg.theme.colors.primary}EE) 45deg";
|
|
|
|
"col.inactive_border" = "rgba(${lib.strings.removePrefix "#" cfg.theme.colors.inactive}AA)";
|
|
|
|
allow_tearing = false;
|
2024-07-19 11:10:34 -04:00
|
|
|
border_size = 2;
|
|
|
|
gaps_in = 5;
|
|
|
|
gaps_out = 6;
|
|
|
|
layout = "dwindle";
|
2024-07-19 10:50:27 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
gestures = {
|
|
|
|
workspace_swipe = true;
|
|
|
|
workspace_swipe_touch = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
master = {
|
|
|
|
always_center_master = true;
|
|
|
|
new_status = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
misc = {
|
|
|
|
disable_hyprland_logo = true;
|
|
|
|
disable_splash_rendering = true;
|
|
|
|
focus_on_activate = true;
|
|
|
|
vfr = true;
|
|
|
|
};
|
|
|
|
|
2024-07-19 11:36:35 -04:00
|
|
|
monitor =
|
|
|
|
[",preferred,auto,auto"]
|
|
|
|
++ cfg.desktop.hyprland.laptopMonitors
|
|
|
|
++ cfg.desktop.hyprland.monitors;
|
|
|
|
|
2024-07-19 11:10:34 -04:00
|
|
|
windowrulev2 = windowRules;
|
2024-07-19 10:50:27 -04:00
|
|
|
xwayland.force_zero_scaling = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
hyprland.extraConfig = let
|
|
|
|
inherit
|
|
|
|
(import ./vars.nix {inherit config lib pkgs;})
|
|
|
|
defaultWorkspaces
|
|
|
|
modifier
|
|
|
|
windowManagerBinds
|
|
|
|
;
|
|
|
|
|
|
|
|
# Hyprland desktop utilities
|
|
|
|
hyprnome = lib.getExe pkgs.hyprnome;
|
2024-07-07 01:36:41 -04:00
|
|
|
in ''
|
2024-07-15 00:14:18 -04:00
|
|
|
bind=CTRL ALT,R,submap,resize
|
|
|
|
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
|
|
|
|
|
|
|
|
bind=CTRL ALT,M,submap,move
|
|
|
|
submap=move
|
|
|
|
# Move window with keys ++
|
|
|
|
# Move workspaces across monitors with CONTROL + keys.
|
|
|
|
${
|
2024-07-07 01:36:41 -04:00
|
|
|
lib.strings.concatLines
|
|
|
|
(
|
|
|
|
lib.attrsets.mapAttrsToList (key: direction: ''
|
|
|
|
bind = , ${key}, movewindow, ${direction}
|
|
|
|
bind = CONTROL, ${key}, movecurrentworkspacetomonitor, ${direction}
|
|
|
|
'')
|
|
|
|
windowManagerBinds
|
|
|
|
)
|
2024-06-10 20:15:27 -04:00
|
|
|
}
|
2024-04-14 14:07:37 -04:00
|
|
|
|
2024-07-15 00:14:18 -04:00
|
|
|
# Move active window to a workspace with [1-9]
|
|
|
|
${
|
2024-07-07 01:36:41 -04:00
|
|
|
lib.strings.concatMapStringsSep "\n"
|
|
|
|
(x: "bind = , ${toString x}, movetoworkspace, ${toString x}")
|
|
|
|
defaultWorkspaces
|
|
|
|
}
|
2024-06-04 21:06:17 -04:00
|
|
|
|
2024-07-15 00:14:18 -04:00
|
|
|
# hyprnome
|
|
|
|
bind = , comma, exec, ${hyprnome} --previous --move
|
|
|
|
bind = , period, exec, ${hyprnome} --move
|
|
|
|
bind=,escape,submap,reset
|
|
|
|
submap=reset
|
2024-07-07 01:36:41 -04:00
|
|
|
'';
|
|
|
|
};
|
2024-07-09 23:40:10 -04:00
|
|
|
};
|
2024-03-28 22:12:08 -04:00
|
|
|
}
|