nixos/home/hyprland/config.nix

241 lines
8.5 KiB
Nix
Raw Normal View History

{ config, pkgs, ... }:
let
themeName = config.gtk.theme.name;
cursorName = config.gtk.cursorTheme.name;
cursorSize = toString config.gtk.cursorTheme.size;
in ''
source = ./extra.conf
monitor=,preferred,auto,auto
env = XDG_CURRENT_DESKTOP=Hyprland
env = XDG_SESSION_TYPE=wayland
env = XDG_SESSION_DESKTOP=Hyprland
env = GDK_BACKEND=wayland,x11
env = GTK_THEME,${themeName}
env = XCURSOR_THEME,${cursorName}
env = XCURSOR_SIZE,${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 = GRIM_DEFAULT_DIR=${config.xdg.userDirs.pictures}/Grim
exec-once = hyprctl setcursor ${cursorName} ${cursorSize}
exec-once = dbus-update-activation-environment --systemd --all
exec-once = systemctl --user import-environment WAYLAND_DISPLAY QT_QPA_PLATFORMTHEME
exec-once = systemctl --user restart xdg-desktop-portal.service xdg-desktop-portal-hyprland.service avizo.service
gestures:workspace_swipe = true
input {
kb_layout = gb
kb_options = ctrl:nocaps
follow_mouse = 1
touchpad:natural_scroll = yes
}
master {
allow_small_split = true
mfact = 0.5
new_is_master = false
new_on_top = false
orientation = left
inherit_fullscreen = true
}
2023-11-21 11:38:56 +00:00
dwindle:force_split = 2
general {
col.active_border = rgb(b4befe)
col.inactive_border = rgb(313244)
gaps_in = 5
gaps_out = 10
border_size = 1
cursor_inactive_timeout = 5
layout = master
}
decoration {
rounding = 10
col.shadow=rgba(0d0e1c99)
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
2023-09-28 07:25:42 +01:00
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
}
2023-12-26 11:01:49 +00:00
misc {
background_color=rgb(0d0e1c)
2023-12-26 11:01:49 +00:00
disable_autoreload = true
mouse_move_enables_dpms = true
key_press_enables_dpms = true
2023-12-26 11:01:49 +00:00
}
xwayland:force_zero_scaling = true
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
bind = SUPER, F1, exec, swaylock
bind = SUPER, Q, killactive,
bind = SUPER SHIFT, Q, exec, rofi -replace -show power-menu
bind = SUPER, V, togglefloating
bind = SUPER, M, fullscreen, 0
bind = SUPER SHIFT, M, fullscreen, 1
bind = SUPER, tab, exec, rofi -replace -show window
bind = SUPER, P, exec, pkill rofi || rofi-pass
bind = SUPER SHIFT, P, exec, pkill rofi || rofi-pass --last-used
bind = SUPER ALT, P, exec, pkill rofi || rofi-pass --insert
2024-01-03 19:18:40 +00:00
bind = SUPER, Z, exec, swaync-client -t -sw
bind = SUPER SHIFT, Z, exec, swaync-client -d -sw
# Common program shortcuts
bind = SUPER, Space, exec, rofi -replace -show combi
bind = SUPER, Return, exec, foot
2024-01-21 10:37:07 +00:00
bind = SUPER SHIFT, Return, exec, emacsclient -c
bind = SUPER, S, exec, foot -e btm --group --battery
# Misc useful binds
2023-11-22 13:57:54 +00:00
bind=,Print,exec,grim -g "$(slurp)"
bind=,XF86Calculator,exec,rofi -replace -show calc
2023-10-12 16:24:55 +01:00
# 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
2023-10-12 16:24:55 +01:00
# Brightness
bindle=,XF86MonBrightnessUp,exec,${pkgs.avizo}/bin/lightctl + 5
bindle=,XF86MonBrightnessDown,exec,${pkgs.avizo}/bin/lightctl - 5
2023-10-12 16:24:55 +01:00
# 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
2024-01-03 16:46:20 +00:00
$layers = ^(waybar|system-menu|rofi|gtk-layer-shell|notifications|swaync-.*)$
layerrule = blur, $layers
layerrule = ignorealpha 0.3, $layers
2023-09-05 12:49:33 +01:00
# Window rules
windowrule = float,(org.kde.polkit-kde-authentication-agent-1|Pinentry)
windowrule = center,(org.kde.polkit-kde-authentication-agent-1|Pinentry)
windowrule = pin,(org.kde.polkit-kde-authentication-agent-1|Pinentry)
windowrule = dimaround,(org.kde.polkit-kde-authentication-agent-1|Pinentry)
windowrule = stayfocused,(org.kde.polkit-kde-authentication-agent-1|Pinentry)
windowrule = float,(pavucontrol|.blueman-manager-wrapped|nm-connection-editor)
windowrule = size 800 600,(pavucontrol|.blueman-manager-wrapped|nm-connection-editor)
windowrule = move onscreen 100%-820 60,(pavucontrol|.blueman-manager-wrapped|nm-connection-editor)
windowrulev2 = float,title:(Picture-in-Picture|Library),class:(firefox)
windowrulev2 = size 750 400,title:(Picture-in-Picture),class:(firefox)
windowrulev2 = size 800 800,title:(Library),class:(firefox)
windowrulev2 = move onscreen 100%-775 100%-425,title:(Picture-in-Picture),class:(firefox)
windowrulev2 = center,title:(Library),class:(firefox)
windowrulev2 = pin,title:(Picture-in-Picture),class:(firefox)
windowrule = nomaximizerequest, (libreoffice|soffice)(.*)
windowrule = nofullscreenrequest, (libreoffice|soffice)(.*)
windowrulev2 = float,title:(Open),class:(libreoffice|soffice)(.*))
windowrulev2 = float,title:(Friends List),class:(steam)
windowrulev2 = float,title:(Steam Settings),class:(steam)
windowrule = nofullscreenrequest,(org.remmina.Remmina|Nxplayer.bin)
windowrule = nomaximizerequest,(org.remmina.Remmina|Nxplayer.bin)
windowrulev2 = float,title:(Remmina Remote Desktop Client|Remmina Preferences),class:(org.remmina.Remmina)
windowrulev2 = size 800 600,title:(Remmina Remote Desktop Client|Remmina Preferences),class:(org.remmina.Remmina)
windowrulev2 = move onscreen 100%-820 60,title:(Remmina Remote Desktop Client|Remmina Preferences),class:(org.remmina.Remmina)
# 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, bracketright, focusmonitor, +1
bind = SUPER SHIFT, bracketright, movecurrentworkspacetomonitor, +1
bind = SUPER, bracketleft, focusmonitor, -1
bind = SUPER SHIFT, bracketleft, movecurrentworkspacetomonitor, -1
bind = SUPER, U, focusurgentorlast
# Numbered workspaces
bind = SUPER, 1, moveworkspacetomonitor, 1 current
bind = SUPER, 1, workspace, 1
bind = SUPER SHIFT, 1, movetoworkspace, 1
bind = SUPER, 2, moveworkspacetomonitor, 2 current
bind = SUPER, 2, workspace, 2
bind = SUPER SHIFT, 2, movetoworkspace, 2
bind = SUPER, 3, moveworkspacetomonitor, 3 current
bind = SUPER, 3, workspace, 3
bind = SUPER SHIFT, 3, movetoworkspace, 3
bind = SUPER, 4, moveworkspacetomonitor, 4 current
bind = SUPER, 4, workspace, 4
bind = SUPER SHIFT, 4, movetoworkspace, 4
bind = SUPER, 5, moveworkspacetomonitor, 5 current
bind = SUPER, 5, workspace, 5
bind = SUPER SHIFT, 5, movetoworkspace, 5
bind = SUPER, 6, moveworkspacetomonitor, 6 current
bind = SUPER, 6, workspace, 6
bind = SUPER SHIFT, 6, movetoworkspace, 6
bind = SUPER, 7, moveworkspacetomonitor, 7 current
bind = SUPER, 7, workspace, 7
bind = SUPER SHIFT, 7, movetoworkspace, 7
bind = SUPER, 8, moveworkspacetomonitor, 8 current
bind = SUPER, 8, workspace, 8
bind = SUPER SHIFT, 8, movetoworkspace, 8
bind = SUPER, 9, moveworkspacetomonitor, 9 current
bind = SUPER, 9, workspace, 9
bind = SUPER SHIFT, 9, movetoworkspace, 9
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = SUPER, mouse:272, movewindow
bindm = SUPER, mouse:273, resizewindow
exec-once = emacs --fg-daemon
2024-01-03 19:18:40 +00:00
exec-once = swaync
2023-09-11 13:46:52 +01:00
exec-once = ${pkgs.hyprpaper}/bin/hyprpaper
exec-once = ${pkgs.dex}/bin/dex --autostart
exec-once = [workspace name:btm silent]
''