nixos/home/hyprland/config.nix
Evie Litherland-Smith 740325f707 Add firefox back as default browser
Add firefox and chromium to web workspace, keep nyxt installed as
quick popup browser to use elsewhere

Remove discord workspace, move to apps workspace

Add files workspace for thunar and libreoffice

Add more waybar rewrites - libreoffice programs, thunar, PWAs like
whatsapp web, etc...
2023-12-05 12:47:30 +00:00

241 lines
8.9 KiB
Nix

{ 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}/Screenshots
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
misc:background_color=rgb(1a1b26)
gestures:workspace_swipe = true
input {
kb_layout = gb
kb_options = ctrl:nocaps
follow_mouse = 1
touchpad:natural_scroll = yes
}
dwindle:force_split = 2
general {
col.active_border=rgb(bb9af7)
col.inactive_border=rgb(414868)
gaps_in = 5
gaps_out = 10
border_size = 1
cursor_inactive_timeout = 5
layout = dwindle
}
decoration {
rounding = 10
col.shadow=rgba(1a1b2699)
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, 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
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, rofi -replace -show combi
bind = SUPER, Return, exec, alacritty
# Misc useful binds
bind=,Print,exec,grim -g "$(slurp)"
bind=,XF86Calculator,exec,rofi -replace -show calc
# 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|rofi|gtk-layer-shell|notifications)$
layerrule = blur, $layers
layerrule = ignorealpha 0.3, $layers
# Window rules
windowrule = float,(org.kde.polkit-kde-authentication-agent-1d|Pinentry)
windowrule = center,(org.kde.polkit-kde-authentication-agent-1d|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|thunar)
windowrule = size 800 600,(pavucontrol|.blueman-manager-wrapped|nm-connection-editor|thunar)
windowrule = move onscreen 100%-820 60,(pavucontrol|.blueman-manager-wrapped|nm-connection-editor)
windowrule = nomaximizerequest,(libreoffice|soffice)(.*)
windowrule = nofullscreenrequest, (libreoffice|soffice)(.*)
windowrule = nofullscreenrequest,(org.remmina.Remmina|Nxplayer.bin)
windowrule = nomaximizerequest,(org.remmina.Remmina|Nxplayer.bin)
windowrule = float,(org.remmina.Remmina|Nxplayer.bin)
windowrule = minsize 1280 720,(org.remmina.Remmina|Nxplayer.bin)
windowrule = maxsize 1920 1080,(org.remmina.Remmina|Nxplayer.bin)
windowrulev2 = float,title:(Open),class:(libreoffice|soffice)(.*))
windowrulev2 = float,title:(Friends List),class:(steam)
windowrulev2 = float,title:(Steam Settings),class:(steam)
# Workspace definitions
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
# Named workspaces
bind = SUPER, E, moveworkspacetomonitor, name:emacs current
bind = SUPER, E, workspace, name:emacs
bind = SUPER SHIFT, E, movetoworkspace, name:emacs
bind = SUPER ALT, E, exec, [workspace name:emacs] emacs
bind = SUPER, W, moveworkspacetomonitor, name:web current
bind = SUPER, W, workspace, name:web
bind = SUPER SHIFT, W, movetoworkspace, name:web
bind = SUPER ALT, W, exec, [workspace name:web] nyxt
windowrule = workspace name:web, (firefox|chromium-browser)
bind = SUPER, T, moveworkspacetomonitor, name:top current
bind = SUPER, T, workspace, name:top
bind = SUPER SHIFT, T, movetoworkspace, name:top
bind = SUPER ALT, T, exec, [workspace name:top] alacritty -e btop
bind = SUPER, A, moveworkspacetomonitor, name:apps current
bind = SUPER, A, workspace, name:apps
bind = SUPER SHIFT, A, movetoworkspace, name:apps
windowrule = workspace name:apps, (discord)
windowrule = workspace name:apps, (Signal)
windowrule = workspace name:apps, chrome-(.*)-Default
bind = SUPER, F, moveworkspacetomonitor, name:files current
bind = SUPER, F, workspace, name:files
bind = SUPER SHIFT, F, movetoworkspace, name:files
windowrule = workspace name:files, (thunar)
windowrule = workspace name:files, (libreoffice|soffice)(.*)
bind = SUPER, S, moveworkspacetomonitor, name:steam current
bind = SUPER, S, workspace, name:steam
bind = SUPER SHIFT, S, movetoworkspace, name:steam
windowrule = workspace name:steam, (steam)
bind = SUPER, R, moveworkspacetomonitor, name:remote current
bind = SUPER, R, workspace, name:remote
bind = SUPER SHIFT, R, movetoworkspace, name:remote
windowrule = workspace name:remote, (org.remmina.Remmina)
windowrule = workspace name:remote, (Nxplayer.bin)
# 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
# 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
''