Finish converting hyprland config to nix expression

This commit is contained in:
Evie Litherland-Smith 2024-01-27 08:09:57 +00:00
parent 138ad088ea
commit eb203df057
2 changed files with 148 additions and 147 deletions

View file

@ -1,142 +0,0 @@
{ config, pkgs, ... }: ''
# 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
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
bind = SUPER SHIFT, Return, exec, emacsclient -c
bind = SUPER, S, exec, foot -e btm --group --battery
bind = SUPER, W, exec, nyxt --no-socket --with-file bookmarks=${
../nyxt/bookmarks.lisp
}
bind = SUPER, F, exec, thunar $HOME
# 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|swaync-.*)$
layerrule = blur, $layers
layerrule = ignorealpha 0.3, $layers
# 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, r-1
bind = SUPER SHIFT, comma, movetoworkspace, r-1
bind = SUPER, period, workspace, r+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
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = SUPER, mouse:272, movewindow
bindm = SUPER, mouse:273, resizewindow
exec-once = dbus-update-activation-environment --systemd --all
exec-once = systemctl --user import-environment WAYLAND_DISPLAY QT_QPA_PLATFORMTHEME
exec-once = git -C $HOME/.emacs pull --ff-only; emacs --fg-daemon
exec-once = swaync
exec-once = ${pkgs.hyprpaper}/bin/hyprpaper
exec-once = ${pkgs.dex}/bin/dex --autostart
''

View file

@ -122,9 +122,14 @@
"MOZ_ENABLE_WAYLAND,1"
"GRIM_DEFAULT_DIR=${xdg.userDirs.pictures}/Grim"
];
exec-once = with config;
[
exec-once = with config; [
"dbus-update-activation-environment --systemd --all"
"systemctl --user import-environment WAYLAND_DISPLAY QT_QPA_PLATFORMTHEME"
"hyprctl setcursor ${gtk.theme.name} ${toString gtk.cursorTheme.size}"
"git -C $HOME/.emacs pull --ff-only; emacs --fg-daemon"
"swaync"
"${pkgs.hyprpaper}/bin/hyprpaper"
"${pkgs.dex}/bin/dex --autostart"
];
gestures.workspace_swipe = true;
input = {
@ -189,7 +194,145 @@
key_press_enables_dpms = true;
};
xwayland.force_zero_scaling = true;
layerrule = let
blur = x: "blur, ^(${x})$";
ignorealpha = x: "ignorealpha 0.3, ^(${x})$";
layers = [
"waybar"
"system-menu"
"rofi"
"gtk-layer-shell"
"notifications"
"swaync-.*"
];
in (lib.lists.forEach layers blur)
++ (lib.lists.forEach layers ignorealpha);
windowrule = [
# Float + move system windows
"float,(org.kde.polkit-kde-authentication-agent-1|Pinentry)"
"center,(org.kde.polkit-kde-authentication-agent-1|Pinentry)"
"pin,(org.kde.polkit-kde-authentication-agent-1|Pinentry)"
"dimaround,(org.kde.polkit-kde-authentication-agent-1|Pinentry)"
"stayfocused,(org.kde.polkit-kde-authentication-agent-1|Pinentry)"
"float,(pavucontrol|.blueman-manager-wrapped|nm-connection-editor)"
"size 800 600,(pavucontrol|.blueman-manager-wrapped|nm-connection-editor)"
"move onscreen 100%-820 60,(pavucontrol|.blueman-manager-wrapped|nm-connection-editor)"
# LibreOffice
"nomaximizerequest, (libreoffice|soffice)(.*)"
"nofullscreenrequest, (libreoffice|soffice)(.*)"
# Remmina / NoMachine
"nofullscreenrequest,(org.remmina.Remmina|Nxplayer.bin)"
"nomaximizerequest,(org.remmina.Remmina|Nxplayer.bin)"
];
windowrulev2 = [
# Firefox PIP
"float,title:(Picture-in-Picture|Library),class:(firefox)"
"size 750 400,title:(Picture-in-Picture),class:(firefox)"
"size 800 800,title:(Library),class:(firefox)"
"move onscreen 100%-775 100%-425,title:(Picture-in-Picture),class:(firefox)"
"center,title:(Library),class:(firefox)"
"pin,title:(Picture-in-Picture),class:(firefox)"
# LibreOffice
"float,title:(Open),class:(libreoffice|soffice)(.*))"
# Steam
"float,title:(Friends List),class:(steam)"
"float,title:(Steam Settings),class:(steam)"
# Remmina / NoMachine
"float,title:(Remmina Remote Desktop Client|Remmina Preferences),class:(org.remmina.Remmina)"
"size 800 600,title:(Remmina Remote Desktop Client|Remmina Preferences),class:(org.remmina.Remmina)"
"move onscreen 100%-820 60,title:(Remmina Remote Desktop Client|Remmina Preferences),class:(org.remmina.Remmina)"
];
bind = let
workspace = w: [
"SUPER, ${toString w}, moveworkspacetomonitor, ${toString w} current"
"SUPER, ${toString w}, workspace, ${toString w}"
"SUPER SHIFT, ${toString w}, movetoworkspace, ${toString w}"
];
in with lib.lists;
flatten (forEach (range 1 9) workspace) ++ [
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
"SUPER, F1, exec, swaylock"
"SUPER, Q, killactive,"
"SUPER SHIFT, Q, exec, rofi -replace -show power-menu"
"SUPER, V, togglefloating"
"SUPER, M, fullscreen, 0"
"SUPER SHIFT, M, fullscreen, 1"
"SUPER, tab, exec, rofi -replace -show window"
"SUPER, P, exec, pkill rofi || rofi-pass"
"SUPER SHIFT, P, exec, pkill rofi || rofi-pass --last-used"
"SUPER ALT, P, exec, pkill rofi || rofi-pass --insert"
"SUPER, Z, exec, swaync-client -t -sw"
"SUPER SHIFT, Z, exec, swaync-client -d -sw"
# Common program shortcuts
"SUPER, Space, exec, rofi -replace -show combi"
"SUPER, Return, exec, foot"
"SUPER SHIFT, Return, exec, emacsclient -c"
"SUPER, S, exec, foot -e btm --group --battery"
"SUPER, W, exec, nyxt --no-socket --with-file bookmarks=${
../nyxt/bookmarks.lisp
}"
"SUPER, F, exec, thunar $HOME"
# Misc useful binds
'',Print,exec,${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)"''
",XF86Calculator,exec,rofi -replace -show calc"
# Movement binds
"SUPER, H, movefocus, l"
"SUPER, L, movefocus, r"
"SUPER, K, movefocus, u"
"SUPER, J, movefocus, d"
"SUPER SHIFT, H, movewindow, l"
"SUPER SHIFT, L, movewindow, r"
"SUPER SHIFT, K, movewindow, u"
"SUPER SHIFT, J, movewindow, d"
# Special workspaces
"SUPER, comma, workspace, r-1"
"SUPER SHIFT, comma, movetoworkspace, r-1"
"SUPER, period, workspace, r+1"
"SUPER SHIFT, period, movetoworkspace, r+1"
"SUPER, N, workspace, empty"
"SUPER SHIFT, N, movetoworkspace, empty"
"SUPER, minus, togglespecialworkspace"
"SUPER SHIFT, minus, movetoworkspace, special"
"SUPER, bracketright, focusmonitor, +1"
"SUPER SHIFT, bracketright, movecurrentworkspacetomonitor, +1"
"SUPER, bracketleft, focusmonitor, -1"
"SUPER SHIFT, bracketleft, movecurrentworkspacetomonitor, -1"
"SUPER, O, focusurgentorlast"
];
bindl = [
# Sound
",XF86AudioMute,exec,${pkgs.avizo}/bin/volumectl %"
",XF86AudioMicMute,exec,${pkgs.avizo}/bin/volumectl -m %"
# Playback
",XF86AudioPlay,exec,${pkgs.playerctl}/bin/playerctl play-pause"
",XF86AudioStop,exec,${pkgs.playerctl}/bin/playerctl play-pause"
",XF86AudioPrev,exec,${pkgs.playerctl}/bin/playerctl previous"
",XF86AudioNext,exec,${pkgs.playerctl}/bin/playerctl next"
];
bindle = [
# Sound
",XF86AudioRaiseVolume,exec,${pkgs.avizo}/bin/volumectl -u + 5"
",XF86AudioLowerVolume,exec,${pkgs.avizo}/bin/volumectl -u - 5"
# Brightness
",XF86MonBrightnessUp,exec,${pkgs.avizo}/bin/lightctl + 5"
",XF86MonBrightnessDown,exec,${pkgs.avizo}/bin/lightctl - 5"
];
bindm = [
# Move/resize windows with mainMod + LMB/RMB and dragging
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
];
};
extraConfig = import ./config.nix { inherit config pkgs; };
};
}