feat: add hyprscratch scratchpad management with rule reapply fork

- Add hyprscratch from colonelpanic8/reapply-rules-on-toggle fork that
  reapplies size/position/float rules on every toggle (not just spawn)
- Configure 9 scratchpads: htop, volume, spotify, element, slack,
  transmission, dropdown, gmail, messages
- Use clean mode (hide on workspace change) and auto-dismiss (only
  dropdown persists)
- Fix pavucontrol class (org.pulseaudio.pavucontrol) and dropdown
  position (offset by taffybar height)
- Add kanshi-sni, dbus-menu, dbus-hslogger flake inputs and follows

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-10 22:25:58 -08:00
committed by Kat Huang
parent a15fee5b30
commit cf8892152c
5 changed files with 180 additions and 95 deletions

View File

@@ -201,61 +201,14 @@ binds {
# WINDOW RULES
# =============================================================================
# Float dialogs
windowrulev2 = float, class:^()$,title:^()$
windowrulev2 = float, title:^(Picture-in-Picture)$
windowrulev2 = float, title:^(Open File)$
windowrulev2 = float, title:^(Save File)$
windowrulev2 = float, title:^(Confirm)$
windowrule = match:class ^()$, match:title ^()$, float on
windowrule = match:title ^(Picture-in-Picture)$, float on
windowrule = match:title ^(Open File)$, float on
windowrule = match:title ^(Save File)$, float on
windowrule = match:title ^(Confirm)$, float on
# Scratchpad windows - float and size
windowrulev2 = workspace special:htop silent, class:^(htop-scratch)$
windowrulev2 = float, class:^(htop-scratch)$
windowrulev2 = size 90% 90%, class:^(htop-scratch)$
windowrulev2 = center, class:^(htop-scratch)$
windowrulev2 = workspace special:volume silent, class:^(?i)(pavucontrol|pavucontrol-qt|org\.pulseaudio\.pavucontrol)$
windowrulev2 = float, class:^(?i)(pavucontrol|pavucontrol-qt|org\.pulseaudio\.pavucontrol)$
windowrulev2 = size 90% 90%, class:^(?i)(pavucontrol|pavucontrol-qt|org\.pulseaudio\.pavucontrol)$
windowrulev2 = center, class:^(?i)(pavucontrol|pavucontrol-qt|org\.pulseaudio\.pavucontrol)$
windowrulev2 = workspace special:spotify silent, class:^(spotify)$
windowrulev2 = float, class:^(spotify)$
windowrulev2 = size 90% 90%, class:^(spotify)$
windowrulev2 = center, class:^(spotify)$
windowrulev2 = workspace special:element silent, class:^(Element)$
windowrulev2 = float, class:^(Element)$
windowrulev2 = size 90% 90%, class:^(Element)$
windowrulev2 = center, class:^(Element)$
windowrulev2 = workspace special:slack silent, class:^(Slack)$
windowrulev2 = float, class:^(Slack)$
windowrulev2 = size 90% 90%, class:^(Slack)$
windowrulev2 = center, class:^(Slack)$
windowrulev2 = workspace special:transmission silent, class:^(transmission-gtk)$
windowrulev2 = float, class:^(transmission-gtk)$
windowrulev2 = size 90% 90%, class:^(transmission-gtk)$
windowrulev2 = center, class:^(transmission-gtk)$
windowrulev2 = workspace special:dropdown silent, class:^(com\.mitchellh\.ghostty\.dropdown)$
windowrulev2 = float, class:^(com\.mitchellh\.ghostty\.dropdown)$
windowrulev2 = size 100% 50%, class:^(com\.mitchellh\.ghostty\.dropdown)$
windowrulev2 = move 0 0, class:^(com\.mitchellh\.ghostty\.dropdown)$
windowrulev2 = noborder, class:^(com\.mitchellh\.ghostty\.dropdown)$
windowrulev2 = noshadow, class:^(com\.mitchellh\.ghostty\.dropdown)$
windowrulev2 = animation slide, class:^(com\.mitchellh\.ghostty\.dropdown)$
# Gmail and Messages (Chrome windows)
windowrulev2 = workspace special:gmail silent, class:^(google-chrome)$,title:^(.*@gmail.com.*Gmail.*)$
windowrulev2 = float, class:^(google-chrome)$,title:^(.*@gmail.com.*Gmail.*)$
windowrulev2 = size 90% 90%, class:^(google-chrome)$,title:^(.*@gmail.com.*Gmail.*)$
windowrulev2 = center, class:^(google-chrome)$,title:^(.*@gmail.com.*Gmail.*)$
windowrulev2 = workspace special:messages silent, class:^(google-chrome)$,title:^(Messages.*)$
windowrulev2 = float, class:^(google-chrome)$,title:^(Messages.*)$
windowrulev2 = size 90% 90%, class:^(google-chrome)$,title:^(Messages.*)$
windowrulev2 = center, class:^(google-chrome)$,title:^(Messages.*)$
# Scratchpad sizing handled by hyprscratch exec rules (see hyprland.nix)
# Using hyprscratch rules instead of windowrule to avoid affecting child windows (e.g. Slack meets)
# =============================================================================
# KEY BINDINGS
@@ -288,28 +241,17 @@ bind = $mainMod, V, exec, wl-paste | xdotool type --file -
bind = $modAlt, C, exec, ~/.config/hypr/scripts/raise-or-run.sh google-chrome google-chrome-stable
# -----------------------------------------------------------------------------
# SCRATCHPADS (Special Workspaces)
# SCRATCHPADS (managed by hyprscratch daemon with auto-dismiss)
# -----------------------------------------------------------------------------
# Toggle scratchpads
bind = $modAlt, E, exec, ~/.config/hypr/scripts/toggle-scratchpad.sh element '^Element$' - element-desktop
bind = $modAlt, G, exec, ~/.config/hypr/scripts/toggle-scratchpad.sh gmail '^google-chrome$' '.*@gmail.com.*Gmail.*' google-chrome-stable --new-window https://mail.google.com/mail/u/0/#inbox
bind = $modAlt, H, exec, ~/.config/hypr/scripts/toggle-scratchpad.sh htop '^htop-scratch$' - alacritty --class htop-scratch --title htop -e htop
bind = $modAlt, M, exec, ~/.config/hypr/scripts/toggle-scratchpad.sh messages '^google-chrome$' '^Messages.*' google-chrome-stable --new-window https://messages.google.com/web/conversations
bind = $modAlt, K, exec, ~/.config/hypr/scripts/toggle-scratchpad.sh slack '^Slack$' - slack
bind = $modAlt, S, exec, ~/.config/hypr/scripts/toggle-scratchpad.sh spotify '^spotify$' - spotify
bind = $modAlt, T, exec, ~/.config/hypr/scripts/toggle-scratchpad.sh transmission '^transmission-gtk$' - transmission-gtk
bind = $modAlt, V, exec, ~/.config/hypr/scripts/toggle-scratchpad.sh volume '^(pavucontrol|pavucontrol-qt|org\.pulseaudio\.pavucontrol)$' - pavucontrol
bind = $modAlt, grave, exec, ~/.config/hypr/scripts/toggle-scratchpad.sh dropdown '^com\.mitchellh\.ghostty\.dropdown$' - ghostty --config-file=/home/imalison/.config/ghostty/dropdown
# Move windows to scratchpads
bind = $modAlt SHIFT, E, movetoworkspace, special:element
bind = $modAlt SHIFT, G, movetoworkspace, special:gmail
bind = $modAlt SHIFT, H, movetoworkspace, special:htop
bind = $modAlt SHIFT, M, movetoworkspace, special:messages
bind = $modAlt SHIFT, K, movetoworkspace, special:slack
bind = $modAlt SHIFT, S, movetoworkspace, special:spotify
bind = $modAlt SHIFT, T, movetoworkspace, special:transmission
bind = $modAlt SHIFT, V, movetoworkspace, special:volume
bind = $modAlt, E, exec, hyprscratch toggle element
bind = $modAlt, G, exec, hyprscratch toggle gmail
bind = $modAlt, H, exec, hyprscratch toggle htop
bind = $modAlt, M, exec, hyprscratch toggle messages
bind = $modAlt, K, exec, hyprscratch toggle slack
bind = $modAlt, S, exec, hyprscratch toggle spotify
bind = $modAlt, T, exec, hyprscratch toggle transmission
bind = $modAlt, V, exec, hyprscratch toggle volume
bind = $modAlt, grave, exec, hyprscratch toggle dropdown
# Hidden workspace (like XMonad's NSP)
bind = $mainMod, X, movetoworkspace, special:NSP
@@ -579,22 +521,14 @@ bind = $mainMod, mouse_up, exec, ~/.config/hypr/scripts/workspace-scroll.sh -1
# AUTOSTART
# =============================================================================
# Start Hyprland session target for systemd user services (e.g., waybar)
# Wire Hyprland into Home Manager's standard user-session targets.
# `graphical-session.target` pulls in most tray/SNI applets (which in turn pull in `tray.target`).
exec-once = systemctl --user set-environment IMALISON_SESSION_TYPE=wayland
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE
exec-once = systemctl --user start graphical-session.target
exec-once = systemctl --user start hyprland-session.target
exec-once = ~/.config/hypr/scripts/workspace-history.sh
# Scratchpad applications (spawn on demand via keybinds)
# exec-once = [workspace special:element silent] element-desktop
# exec-once = [workspace special:gmail silent] google-chrome-stable --new-window https://mail.google.com/mail/u/0/#inbox
# exec-once = [workspace special:htop silent] ghostty --class=htop-scratch --title=htop -e htop
# exec-once = [workspace special:messages silent] google-chrome-stable --new-window https://messages.google.com/web/conversations
# exec-once = [workspace special:slack silent] slack
# exec-once = [workspace special:spotify silent] spotify
# exec-once = [workspace special:transmission silent] transmission-gtk
# exec-once = [workspace special:volume silent] pavucontrol
# Clipboard history daemon
exec-once = wl-paste --type text --watch cliphist store
exec-once = wl-paste --type image --watch cliphist store

View File

@@ -0,0 +1 @@
/nix/store/nax7ksh59bapd3swghaj2ky60krnnzmg-home-manager-files/.config/hypr/hyprscratch.conf