151 lines
4.4 KiB
Nix
151 lines
4.4 KiB
Nix
{pkgs, ...}: {
|
|
wayland.windowManager.hyprland = let
|
|
locker = "${pkgs.swaylock}/bin/swaylock";
|
|
set-dpms = "${pkgs.hyprland}/bin/hyprctl dispatcher dpms";
|
|
locked-dpms = pkgs.writeShellScript "locked-dpms.sh" ''
|
|
${pkgs.swayidle}/bin/swayidle -w \
|
|
timeout 10 'if pgrep -x swaylock; then ${set-dpms} off; fi' \
|
|
resume '${set-dpms} on'
|
|
'';
|
|
idle-script = pkgs.writeShellScript "idle-lock.sh" ''
|
|
${pkgs.swayidle}/bin/swayidle -w \
|
|
timeout 300 '${locker} -f' \
|
|
timeout 330 '${set-dpms} off' \
|
|
resume '${set-dpms} on'
|
|
'';
|
|
in {
|
|
enable = true;
|
|
|
|
settings = {
|
|
"$mod" = "SUPER";
|
|
|
|
exec-once = [
|
|
"${pkgs.waybar}/bin/waybar"
|
|
"${pkgs.mako}/bin/mako"
|
|
idle-script
|
|
locked-dpms
|
|
];
|
|
|
|
monitor = [
|
|
"eDP-1,1920x1080,0x0,1.333333" # Laptop screen
|
|
"desc:Dell Inc. DELL P2723DE 79RFH14,2560x1440,1440x0,1"
|
|
"desc:Dell Inc. DELL P2723DE 39RFH14,2560x1440,4000x0,1"
|
|
# "desc:LG Electronics LG ULTRAWIDE 0x000219F2,2560x1080,1440x0,1" # Primary @home
|
|
# "desc:Fujitsu Siemens Computers GmbH B22W-6 LED YV3U164923,1680x1050,4000x0,1" # Secondary @home
|
|
",preferred,auto,1" # Automatically configure everything else
|
|
];
|
|
|
|
device = [
|
|
{
|
|
name = "razer-razer-blackwidow-chroma";
|
|
kb_layout = "de";
|
|
}
|
|
{
|
|
name = "at-translated-set-2-keyboard";
|
|
kb_layout = "de";
|
|
}
|
|
];
|
|
|
|
input = {
|
|
kb_layout = "us,de";
|
|
follow_mouse = 1;
|
|
};
|
|
|
|
general = {
|
|
gaps_in = 5;
|
|
gaps_out = 5;
|
|
border_size = 1;
|
|
layout = "dwindle";
|
|
allow_tearing = false;
|
|
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
|
|
"col.inactive_border" = "rgba(595959aa)";
|
|
};
|
|
|
|
decoration = {
|
|
rounding = 5;
|
|
shadow = {
|
|
enabled = true;
|
|
range = 4;
|
|
render_power = 3;
|
|
color = "rgba(1a1a1aee)";
|
|
};
|
|
|
|
blur = {
|
|
enabled = true;
|
|
size = 3;
|
|
passes = 1;
|
|
};
|
|
};
|
|
|
|
animations = {
|
|
enabled = true;
|
|
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
|
|
|
|
animation = [
|
|
"windows, 1, 3, myBezier"
|
|
"windowsOut, 1, 3, default, popin 80%"
|
|
"border, 1, 3, default"
|
|
"borderangle, 1, 3, default"
|
|
"fade, 1, 3, default"
|
|
"workspaces, 1, 3, default"
|
|
];
|
|
};
|
|
|
|
bind =
|
|
[
|
|
", PRINT, exec, ${pkgs.hyprshot}/bin/hyprshot -m region --clipboard-only"
|
|
"$mod, return, exec, ${pkgs.alacritty}/bin/alacritty"
|
|
"$mod, D, exec, ${pkgs.rofi-wayland}/bin/rofi -show drun"
|
|
"$mod SHIFT, Q, killactive, "
|
|
"$mod, L, exec, ${locker}"
|
|
"$mod, V, togglefloating, "
|
|
"$mod, F, fullscreen, 1"
|
|
"$mod, P, pseudo, # dwindle"
|
|
"$mod, J, togglesplit, # dwindle"
|
|
"$mod, left, movefocus, l"
|
|
"$mod, right, movefocus, r"
|
|
"$mod, up, movefocus, u"
|
|
"$mod, down, movefocus, d"
|
|
"$mod, S, togglespecialworkspace, magic"
|
|
"$mod SHIFT, S, movetoworkspace, special:magic"
|
|
]
|
|
++ builtins.concatLists (builtins.genList (
|
|
x: let
|
|
num = builtins.toString (x + 1);
|
|
in [
|
|
"$mod, ${num}, workspace, ${num}"
|
|
"$mod SHIFT, ${num}, movetoworkspace, ${num}"
|
|
]
|
|
)
|
|
9);
|
|
|
|
bindm = [
|
|
"$mod, mouse:272, movewindow"
|
|
"$mod, mouse:273, resizewindow"
|
|
];
|
|
|
|
bindl = [
|
|
"$mod SHIFT, L, exec, ${locker}"
|
|
];
|
|
|
|
windowrulev2 = [
|
|
# KeePassXC
|
|
"float,class:(org.keepassxc.KeePassXC)"
|
|
"size 800 600,class:(org.keepassxc.KeePassXC)"
|
|
# Thunderbird
|
|
"float,class:thunderbird" # Float all thunderbird windows
|
|
"tile,class:thunderbird,title:^(Write)" # Don't float the new mail window
|
|
"tile,class:thunderbird,title:(Mozilla Thunderbird)$" # Also dont float the main window
|
|
"move 100%-606 30,class:thunderbird" # The rest is the notification window. Float it in the top right corner
|
|
"noinitialfocus,class:thunderbird,title:^()$" # Make it not pull focus
|
|
];
|
|
|
|
misc = {
|
|
mouse_move_enables_dpms = true;
|
|
key_press_enables_dpms = true;
|
|
vfr = true;
|
|
};
|
|
};
|
|
};
|
|
}
|