nixos/home/hyprland/config.nix

292 lines
9.8 KiB
Nix

{ config, pkgs, ... }:
let cursorSize = 24;
in ''
source = ./extra.conf
monitor=,preferred,auto,auto
exec-once = hyprctl setcursor ${config.gtk.cursorTheme.name} ${
toString cursorSize
}
env = XDG_CURRENT_DESKTOP=Hyprland
env = XDG_SESSION_TYPE=wayland
env = XDG_SESSION_DESKTOP=Hyprland
env = GDK_BACKEND=wayland,x11
env = GTK_THEME,${config.gtk.theme.name}
env = XCURSOR_THEME,${config.gtk.cursorTheme.name}
env = XCURSOR_SIZE,${toString cursorSize}
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = QT_QPA_PLATFORM,wayland
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = MOZ_ENABLE_WAYLAND,1
env = DOOMLOCALDIR=${config.home.sessionVariables.DOOMLOCALDIR};
env = DOOMPROFILELOADFILE=${config.home.sessionVariables.DOOMPROFILELOADFILE};
misc {
disable_autoreload = true
vrr = 2
}
gestures {
workspace_swipe = true
}
input {
kb_layout = gb
follow_mouse = 1
touchpad {
natural_scroll = yes
}
}
general {
gaps_in = 2.5
gaps_out = 5
border_size = 1
cursor_inactive_timeout = 5
layout = master
}
dwindle {
force_split = 2
preserve_split = true
}
master {
mfact = 0.55
new_is_master = false
new_on_top = false
no_gaps_when_only = 0
orientation = left
}
decoration {
rounding = 5
drop_shadow = yes
shadow_ignore_window = true
shadow_range = 4
shadow_render_power = 3
blur {
enabled = true
size = 5
passes = 3
new_optimizations = true
brightness = 1.0
noise = 0.02
}
}
animations {
enabled = yes
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
XWayland {
force_zero_scaling = true
}
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
bind = SUPER, F1, exec, ${pkgs.gtklock}/bin/gtklock
bind = SUPER, Q, killactive,
bind = SUPER SHIFT, Q, exec, wlogout
bind = SUPER, V, togglefloating
bind = SUPER, M, fullscreen, 0
bind = SUPER SHIFT, M, fullscreen, 1
bind = SUPER, P, exec, pkill rofi || rofi-pass
bind = SUPER SHIFT, P, exec, pkill rofi || rofi-pass --last-used
bind = SUPER, X, exec, ${pkgs.mako}/bin/makoctl restore
bind = SUPER SHIFT, X, exec, ${pkgs.mako}/bin/makoctl dismiss -a
# Common program shortcuts
bind = SUPER, Space, exec, pkill anyrun || anyrun
bind = SUPER, Return, exec, alacritty
bind = SUPER SHIFT, Return, exec, [float] alacritty
bind = SUPER ALT, T, exec, [workspace 1] alacritty
bind = SUPER ALT, D, exec, [workspace 2] emacs
bind = SUPER ALT, W, exec, [workspace 3] firefox
bind = SUPER ALT, A, exec, [workspace 4] alacritty -e khal interactive
bind = SUPER ALT, F, exec, [workspace 5] thunar
bind = SUPER ALT, S, exec, [workspace 6] spot
bind = SUPER ALT, C, exec, [workspace 7] fractal
bind = SUPER ALT, R, exec, [workspace 8] remmina
bind = SUPER ALT, G, exec, [workspace 9] steam
# Misc useful binds
bind=,Print,exec,watershot directory ${config.xdg.userDirs.pictures}
bind=,XF86Calculator,exec,pkill anyrun || anyrun
# Sound
bindl=,XF86AudioMute,exec,${pkgs.avizo}/bin/volumectl %
bindl=,XF86AudioMicMute,exec,${pkgs.avizo}/bin/volumectl -m %
bindle=,XF86AudioRaiseVolume,exec,${pkgs.avizo}/bin/volumectl -u + 5
bindle=,XF86AudioLowerVolume,exec,${pkgs.avizo}/bin/volumectl -u - 5
# Brightness
bindle=,XF86MonBrightnessUp,exec,${pkgs.avizo}/bin/lightctl + 5
bindle=,XF86MonBrightnessDown,exec,${pkgs.avizo}/bin/lightctl - 5
# Playback
bindl=,XF86AudioPlay,exec,${pkgs.playerctl}/bin/playerctl play-pause
bindl=,XF86AudioStop,exec,${pkgs.playerctl}/bin/playerctl play-pause
bindl=,XF86AudioPrev,exec,${pkgs.playerctl}/bin/playerctl previous
bindl=,XF86AudioNext,exec,${pkgs.playerctl}/bin/playerctl next
bind = SUPER, H, movefocus, l
bind = SUPER, L, movefocus, r
bind = SUPER, K, movefocus, u
bind = SUPER, J, movefocus, d
bind = SUPER SHIFT, H, movewindow, l
bind = SUPER SHIFT, L, movewindow, r
bind = SUPER SHIFT, K, movewindow, u
bind = SUPER SHIFT, J, movewindow, d
# Layer rules
$layers = ^(waybar|system-menu|anyrun|gtk-layer-shell|notifications)$
layerrule = blur, $layers
layerrule = ignorealpha 0.3, $layers
# Window rules
windowrule = float,(org.kde.polkit-kde-authentication-agent-1)
windowrule = center,(org.kde.polkit-kde-authentication-agent-1)
windowrule = pin,(org.kde.polkit-kde-authentication-agent-1)
windowrule = dimaround,(org.kde.polkit-kde-authentication-agent-1)
windowrule = stayfocused,(org.kde.polkit-kde-authentication-agent-1)
windowrule = float,(pavucontrol)
windowrule = size 800 600,(pavucontrol)
windowrule = move 100%-820 10%,(pavucontrol)
windowrule = float,(.blueman-manager-wrapped)
windowrule = size 800 600,(.blueman-manager-wrapped)
windowrule = move 100%-820 10%,(.blueman-manager-wrapped)
windowrule = float,(nm-connection-editor)
windowrule = size 800 600,(nm-connection-editor)
windowrule = move 100%-820 10%,(nm-connection-editor)
windowrule = float,(.protonvpn-wrapped)
windowrule = center,(.protonvpn-wrapped)
windowrule = float,(Pinentry)
windowrule = center,(Pinentry)
windowrule = float,(davmail-imap-ImapConnection)
windowrule = center,(davmail-imap-ImapConnection)
windowrule = float,(wlogout)
windowrule = center,(wlogout)
windowrule = size 100% 100%,(wlogout)
windowrule = nofullscreenrequest,(wlogout)
windowrule = nomaximizerequest,(wlogout)
windowrule = noborder,(wlogout)
windowrule = noanim,(wlogout)
windowrule = pin,(wlogout)
windowrule = stayfocused,(wlogout)
windowrule = keepaspectratio,(wlogout)
windowrule = pin,(Rofi)
windowrule = dimaround,(Rofi)
windowrule = stayfocused,(Rofi)
windowrulev2 = float,title:(File|Picture-in-Picture),class:(firefox)
windowrulev2 = float,title:^(Extension.*)$,class:(firefox)
windowrulev2 = pin,title:(File|Picture-in-Picture),class:(firefox)
windowrulev2 = pin,title:^(Extension.*)$,class:(firefox)
windowrulev2 = center,title:(File|Picture-in-Picture),class:(firefox)
windowrulev2 = center,title:^(Extension.*)$,class:(firefox)
windowrulev2 = nofullscreenrequest,title:^(Extension.*)$,class:(firefox)
windowrulev2 = nomaximizerequest,title:^(Extension.*)$,class:(firefox)
windowrulev2 = workspace special silent, title:^(Firefox Sharing Indicator)$,class:(firefox)
windowrulev2 = workspace special silent, title:^(.*is sharing (your screen|a window)\.)$,class:(firefox)
windowrulev2 = float,title:(Open),class:(soffice)
windowrulev2 = float,title:(Friends List),class:(steam)
windowrulev2 = float,title:(Steam Settings),class:(steam)
# Workspace definitions
# 1: [a]ny (or def[a]ult)
bind = SUPER, A, moveworkspacetomonitor, 1 current
bind = SUPER, A, workspace, 1
bind = SUPER SHIFT, A, movetoworkspace, 1
# 2: [t]erminal
bind = SUPER, T, moveworkspacetomonitor, 2 current
bind = SUPER, T, workspace, 2
bind = SUPER SHIFT, T, movetoworkspace, 2
# 3: [d]ev
bind = SUPER, D, moveworkspacetomonitor, 3 current
bind = SUPER, D, workspace, 3
bind = SUPER SHIFT, D, movetoworkspace, 3
windowrule = workspace 3 silent,(emacs)
# 4: [b]rowser
bind = SUPER, W, moveworkspacetomonitor, 4 current
bind = SUPER, W, workspace, 4
bind = SUPER SHIFT, W, movetoworkspace, 4
windowrule = workspace 4 silent,(firefox)
# 5: [f]iles
bind = SUPER, F, moveworkspacetomonitor, 5 current
bind = SUPER, F, workspace, 5
bind = SUPER SHIFT, F, movetoworkspace, 5
windowrule = workspace 5 silent,^(libreoffice).*
windowrulev2 = workspace 5 silent,title:(Open),class:(soffice)
# 6: [s]potify (or mu[s]ic)
bind = SUPER, S, moveworkspacetomonitor, 6 current
bind = SUPER, S, workspace, 6
bind = SUPER SHIFT, S, movetoworkspace, 6
windowrule = workspace 6 silent,(dev.alextren.Spot)
# 7: [c]hat
bind = SUPER, C, moveworkspacetomonitor, 7 current
bind = SUPER, C, workspace, 7
bind = SUPER SHIFT, C, movetoworkspace, 7
windowrule = workspace 7 silent,(Signal)
windowrule = workspace 7 silent,(fractal)
windowrule = workspace 7 silent,(teams-for-linux)
# 8: [r]emote
bind = SUPER, R, moveworkspacetomonitor, 8 current
bind = SUPER, R, workspace, 8
bind = SUPER SHIFT, R, movetoworkspace, 8
windowrule = workspace 8 silent,(org.remmina.Remmina)
windowrule = workspace 8 silent,(Nxplayer.bin)
windowrule = nofullscreenrequest,(Nxplayer.bin)
windowrule = nomaximizerequest,(Nxplayer.bin)
# 9: [g]aming
bind = SUPER, G, moveworkspacetomonitor, 9 current
bind = SUPER, G, workspace, 9
bind = SUPER SHIFT, G, movetoworkspace, 9
windowrule = workspace 9 silent,(steam)
# Special workspaces
bind = SUPER, comma, workspace, m-1
bind = SUPER SHIFT, comma, movetoworkspace, r-1
bind = SUPER, period, workspace, m+1
bind = SUPER SHIFT, period, movetoworkspace, r+1
bind = SUPER, N, workspace, empty
bind = SUPER SHIFT, N, movetoworkspace, empty
bind = SUPER, minus, togglespecialworkspace
bind = SUPER SHIFT, minus, movetoworkspace, special
bind = SUPER, tab, workspace, previous
bind = SUPER SHIFT, tab, movetoworkspace, previous
bind = SUPER, bracketright, focusmonitor, +1
bind = SUPER SHIFT, bracketright, movecurrentworkspacetomonitor, +1
bind = SUPER, bracketleft, focusmonitor, -1
bind = SUPER SHIFT, bracketleft, movecurrentworkspacetomonitor, -1
bind = SUPER, U, focusurgentorlast
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = SUPER, mouse:272, movewindow
bindm = SUPER, mouse:273, resizewindow
exec-once = ${pkgs.hyprpaper}/bin/hyprpaper
exec-once = ${pkgs.mako}/bin/mako
exec-once = ${pkgs.dex}/bin/dex --autostart
exec-once = kidex
exec-once = emacs
exec-once = firefox
exec-once = spot
exec-once = fractal
''