nix/home-manager/shared/wayland/hyprland/default.nix
iofq 26f25fa2ac
Some checks failed
/ check (push) Has been cancelled
3/20
2026-03-20 01:14:15 -05:00

388 lines
10 KiB
Nix

{ pkgs, config, ... }:
{
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = true;
extraConfig = ''
monitor=,preferred,auto-left,1
monitor=DP-4,preferred,auto-left,1
'';
settings = {
"$mod" = "SUPER";
general = {
gaps_in = 0;
gaps_out = 0;
layout = "master";
};
misc = {
disable_hyprland_logo = true;
on_focus_under_fullscreen = 1;
exit_window_retains_fullscreen = 1;
vfr = true;
middle_click_paste = false;
};
ecosystem = {
no_update_news = true;
no_donation_nag = true;
};
decoration = {
blur = {
enabled = false;
};
shadow = {
enabled = false;
};
};
animations = {
enabled = "yes";
animation = [
"windows, 1, 3, default, popin"
"windowsOut, 1, 3, default, popin"
"fade, 1, 3, default"
"workspaces, 1, 3, default, fade"
];
};
master = {
new_status = "slave";
new_on_top = true;
};
input = {
kb_options = "caps:super";
repeat_delay = "250";
repeat_rate = "75";
float_switch_override_focus = 0;
accel_profile = "flat";
sensitivity = 0.4;
touchpad = {
clickfinger_behavior = true;
disable_while_typing = true;
natural_scroll = true;
tap_button_map = "lrm";
middle_button_emulation = false;
drag_lock = true;
};
touchdevice = {
enabled = false;
};
};
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
binde = [
"$mod ALT, h, resizeactive, -50 0"
"$mod ALT, l, resizeactive, 50 0"
"$mod ALT, j, resizeactive, 0 50"
"$mod ALT, k, resizeactive, 0 -50"
];
bind = [
"$mod, Return, exec, alacritty"
"$mod, x, killactive"
"$mod, f, fullscreen"
"$mod SHIFT, Escape, exit"
"$mod SHIFT, f, fullscreenstate, 0 3"
"$mod, Space, exec, ${pkgs.wofi}/bin/wofi --show run"
"$mod, Escape, exec, ${pkgs.wlogout}/bin/wlogout"
"$mod, t, togglefloating"
"$mod, g, togglegroup"
"$mod, b, exec, pkill -SIGUSR1 waybar"
"$mod, bracketleft, exec, grimshot --notify save area /tmp/scrot-$(date \"+%Y-%m-%d\"T\"%H:%M:%S\").png"
"$mod, bracketright, exec, grimshot --notify copy area"
"$mod SHIFT, q, exec, hyprlock"
",XF86MonBrightnessDown, exec, light -U 10"
",XF86MonBrightnessUp, exec, light -A 10"
",XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +1%"
",XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -1%"
",XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle"
"$mod SHIFT, m, exec, hyprctl keyword general:layout master"
"$mod SHIFT, d, exec, hyprctl keyword general:layout dwindle"
"$mod SHIFT, s, exec, hyprctl keyword general:layout scrolling"
## Movement
"$mod, m, layoutmsg, swapwithmaster"
"$mod, e, layoutmsg, orientationnext"
"$mod, i, layoutmsg, addmaster"
"$mod, d, layoutmsg, removemaster"
"$mod, h, movefocus, l"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
"$mod, n, changegroupactive, f"
"$mod, p, changegroupactive, b"
"$mod SHIFT, h, movewindoworgroup, l"
"$mod SHIFT, l, movewindoworgroup, r"
"$mod SHIFT, k, movewindoworgroup, u"
"$mod SHIFT, j, movewindoworgroup, d"
"$mod, COMMA, focusmonitor, l"
"$mod, PERIOD, focusmonitor, r"
"$mod SHIFT, COMMA, movewindow, mon:l"
"$mod SHIFT, PERIOD, movewindow, mon:r"
"$mod, s, togglespecialworkspace"
]
++ (
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
builtins.concatLists (
builtins.genList (
x:
let
ws =
let
c = (x + 1) / 10;
in
toString (x + 1 - (c * 10));
in
[
"$mod, ${ws}, focusworkspaceoncurrentmonitor, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}"
]
) 10
)
);
windowrule = [
"workspace 9, match:class ^(Discord|discord)$"
"workspace 9, match:class ^(Signal|signal)$"
"tile on, match:class ^(Minecraft|minecraft)$"
"opacity 0.0 override 0.0 override, match:class ^(xwaylandvideobridge)$"
"no_initial_focus on , match:class ^(xwaylandvideobridge)$"
"no_focus on , match:class ^(xwaylandvideobridge)$"
"no_anim on , match:class ^(xwaylandvideobridge)$"
"max_size 1 1, match:class ^(xwaylandvideobridge)$"
"no_blur on, match:class ^(xwaylandvideobridge)$"
"border_size 0, match:float 0, match:workspace w[t1]"
"rounding 0, match:float 0, match:workspace w[t1]"
"border_size 0, match:float 0, match:workspace w[tg1]"
"rounding 0, match:float 0, match:workspace w[tg1]"
"border_size 0, match:float 0, match:workspace f[1]"
"rounding 0, match:float 0, match:workspace f[1]"
];
workspace = [
"w[t1], gapsout:0, gapsin:0"
"w[tg1], gapsout:0, gapsin:0"
"f[1], gapsout:0, gapsin:0"
];
};
};
services.hyprpaper = {
enable = true;
settings = {
wallpaper = {
monitor = "";
path = "/home/pape";
};
ipc = "off";
splash = false;
};
};
services.hypridle = {
enable = true;
settings = {
general = {
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
ignore_dbus_inhibit = false;
lock_cmd = "pidof hyprlock || hyprlock";
};
listener = [
{
timeout = 1800;
on-timeout = "systemctl suspend";
}
];
};
};
programs.hyprlock = {
enable = true;
settings = {
background = {
monitor = "";
path = "/home/pape";
blur_passes = 5;
};
general = {
ignore_empty_input = true;
};
input-field = {
monitor = "";
size = "5%, 5%";
outline_thickness = 1;
inner_color = "rgba(0, 0, 0, 0.0)";
hide_input = true;
halign = "center";
valign = "center";
};
};
};
programs.waybar = {
enable = true;
systemd.enable = true;
settings = {
mainBar = {
"height" = 14;
"spacing" = 8;
"layer" = "top";
modules-left = [
"hyprland/workspaces"
];
modules-center = [
"hyprland/window"
];
modules-right = [
"tray"
"cpu"
"memory"
"network"
"temperature"
"pulseaudio"
"battery"
"clock"
];
"hyprland/workspaces" = {
disable-scroll = true;
};
"hyprland/window" = {
max-length = 100;
};
"clock" = {
"format" = "{:%m-%d-%y %H:%M}";
};
"cpu" = {
"format" = "{load} \@{avg_frequency}Ghz";
};
"memory" = {
"format" = "{used}G";
};
"temperature" = {
"thermal-zone" = 2;
"hwmon-path" = "/sys/class/hwmon/hwmon0/temp1_input";
"critical-threshold" = 80;
"format-critical" = "!{temperatureC}°C";
"format" = "{temperatureC}°C";
};
"battery" = {
"states" = {
"warning" = 30;
"critical" = 15;
};
"format" = "{capacity}% {time}";
"format-charging" = "+{capacity}% {time}";
"format-plugged" = "+{capacity}%";
};
"network" = {
"format-wifi" = "{signaldBm}db";
"format-ethernet" = "{ifname}";
"format-disconnected" = "";
"tooltip" = "{ifname} = {ipaddr}/{cidr}";
on-click = "${pkgs.hyprland}/bin/hyprctl dispatch exec \"[float] alacritty -e nmtui\"";
};
"pulseaudio" = {
"format" = "{volume}%";
on-click = "${pkgs.hyprland}/bin/hyprctl dispatch exec \"[float] alacritty -e pulsemixer\"";
};
};
};
style = ''
* {
font-family: "Spleen 32x64", "UbuntuMono Nerd Font";
font-size: 14px;
min-height: 0;
background-color: ${config.programs.alacritty.settings.colors.primary.background};
}
window#waybar {
color: #bababd;
}
window#waybar.hidden {
opacity: 0.2;
}
#workspaces {
}
#window {
margin: 2px;
padding-left: 8px;
padding-right: 8px;
}
button {
border: none;
border-radius: 0;
}
button:hover {
background: inherit;
border-top: 2px solid #bababd;
}
#workspaces button {
padding: 0 4px;
color: #666666;
}
#workspaces button.active {
color:#bababd;
border-top: 2px solid #bababd;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#clock,
#battery,
#cpu,
#memory,
#temperature,
#network,
#pulseaudio,
#tray
{
padding: 2px;
border-top: 2px solid #666666;
color: #bababd;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
}
#temperature.critical {
background-color: #eb4d4b;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: #eb4d4b;
}
'';
};
}