diff options
| author | Craig Jennings <c@cjennings.net> | 2026-01-25 14:02:17 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-01-25 14:02:17 -0600 |
| commit | 75c026d09a12bc157b645f0ee62908837561c33b (patch) | |
| tree | 839facceaeab24f2c42b5069f118207d2b5bd754 /dotfiles/hyprland/.config/hypr/hyprland.conf | |
| parent | cf05aee4ba2028d9148878298d13023340bf2b1f (diff) | |
fix(hyprland): rewrite scratchpads with on-created-empty
- Use workspace rules with on-created-empty for auto-launch
- Single keybind per scratchpad (no more pgrep hacks)
- Use --app-id for reliable class matching
- Update to Hyprland 0.53+ windowrule syntax (match:class)
- Fix size rules to use expressions: (monitor_w*0.6) (monitor_h*0.6)
Diffstat (limited to 'dotfiles/hyprland/.config/hypr/hyprland.conf')
| -rw-r--r-- | dotfiles/hyprland/.config/hypr/hyprland.conf | 103 |
1 files changed, 56 insertions, 47 deletions
diff --git a/dotfiles/hyprland/.config/hypr/hyprland.conf b/dotfiles/hyprland/.config/hypr/hyprland.conf index 166b44b..f3f0cd7 100644 --- a/dotfiles/hyprland/.config/hypr/hyprland.conf +++ b/dotfiles/hyprland/.config/hypr/hyprland.conf @@ -108,15 +108,15 @@ xwayland { } # ============================================================================ -# Window Rules +# Window Rules (Hyprland 0.53+ syntax: match:CONDITION, RULE) # ============================================================================ # Floating windows (from DWM rules) -windowrule = float on, match:class ^(Gimp)$ -windowrule = float on, match:class ^(caffeine)$ -windowrule = float on, match:class ^(blueman-services)$ -windowrule = float on, match:class ^(Blueman-manager)$ -windowrule = float on, match:class ^(qalculate-gtk)$ -windowrule = float on, match:title ^(Event Tester)$ +windowrule = match:class ^(Gimp)$, float on +windowrule = match:class ^(caffeine)$, float on +windowrule = match:class ^(blueman-services)$, float on +windowrule = match:class ^(Blueman-manager)$, float on +windowrule = match:class ^(qalculate-gtk)$, float on +windowrule = match:title ^(Event Tester)$, float on # ============================================================================ # Key Bindings @@ -124,7 +124,7 @@ windowrule = float on, match:title ^(Event Tester)$ $mod = SUPER # Terminal and core apps (from DWM) -bind = $mod, T, exec, st +bind = $mod, T, exec, foot bind = $mod, E, exec, emacsclient -c -a "" || emacs bind = $mod, W, exec, $BROWSER bind = $mod, P, exec, wofi --show drun @@ -215,54 +215,63 @@ bind = $mod, PERIOD, focusmonitor, +1 bind = $mod SHIFT, COMMA, movewindow, mon:-1 bind = $mod SHIFT, PERIOD, movewindow, mon:+1 +# ============================================================================ # Scratchpads (from DWM togglescratch) -# Audio mixer (was MODKEY+a -> spaudio/pulsemixer) +# ============================================================================ +# Using on-created-empty workspace rules - app launches on first toggle, +# subsequent toggles just show/hide the workspace + +# Workspace rules (auto-launch apps when workspace first accessed) +workspace = special:term, on-created-empty:foot --app-id foot-term tmux +workspace = special:audio, on-created-empty:foot --app-id foot-audio pulsemixer +workspace = special:monitor, on-created-empty:foot --app-id foot-monitor gotop +workspace = special:music, on-created-empty:foot --app-id foot-music ncmpcpp +workspace = special:files, on-created-empty:foot --app-id foot-files ranger +workspace = special:htop, on-created-empty:foot --app-id foot-htop htop + +# Keybindings (single bind per scratchpad - just toggle visibility) +bind = $mod SHIFT, RETURN, togglespecialworkspace, term bind = $mod, A, togglespecialworkspace, audio -bind = $mod, A, exec, [workspace special:audio] pgrep -x pulsemixer || st -t spaudio -e pulsemixer -windowrule = float on, match:class ^(st-256color)$, match:title ^(spaudio)$ -windowrule = size 60% 60%, match:class ^(st-256color)$, match:title ^(spaudio)$ -windowrule = center on, match:class ^(st-256color)$, match:title ^(spaudio)$ -windowrule = workspace special:audio, match:class ^(st-256color)$, match:title ^(spaudio)$ - -# System monitor (was MODKEY+m -> spmon/gotop) bind = $mod, M, togglespecialworkspace, monitor -bind = $mod, M, exec, [workspace special:monitor] pgrep -x gotop || st -t spmon -e gotop -windowrule = float on, match:class ^(st-256color)$, match:title ^(spmon)$ -windowrule = size 60% 60%, match:class ^(st-256color)$, match:title ^(spmon)$ -windowrule = workspace special:monitor, match:class ^(st-256color)$, match:title ^(spmon)$ - -# Music player (was MODKEY+slash -> spmp/ncmpcpp) bind = $mod, SLASH, togglespecialworkspace, music -bind = $mod, SLASH, exec, [workspace special:music] pgrep -x ncmpcpp || st -t spmp -e ncmpcpp -windowrule = float on, match:class ^(st-256color)$, match:title ^(spmp)$ -windowrule = size 60% 60%, match:class ^(st-256color)$, match:title ^(spmp)$ -windowrule = workspace special:music, match:class ^(st-256color)$, match:title ^(spmp)$ - -# Terminal scratchpad (was MODKEY+Shift+Return -> spterm/tmux) -bind = $mod SHIFT, RETURN, togglespecialworkspace, term -bind = $mod SHIFT, RETURN, exec, [workspace special:term] pgrep -f "st.*spterm" || st -t spterm -e tmux -windowrule = float on, match:class ^(st-256color)$, match:title ^(spterm)$ -windowrule = size 60% 60%, match:class ^(st-256color)$, match:title ^(spterm)$ -windowrule = workspace special:term, match:class ^(st-256color)$, match:title ^(spterm)$ - -# File manager (was MODKEY+f -> spfm/ranger) bind = $mod, F, togglespecialworkspace, files -bind = $mod, F, exec, [workspace special:files] pgrep -x ranger || st -t spfm -e ranger -windowrule = float on, match:class ^(st-256color)$, match:title ^(spfm)$ -windowrule = size 60% 60%, match:class ^(st-256color)$, match:title ^(spfm)$ -windowrule = workspace special:files, match:class ^(st-256color)$, match:title ^(spfm)$ +bind = $mod SHIFT, H, togglespecialworkspace, htop -# Calculator (was MODKEY+x or MODKEY+c -> qalculate) +# Window rules (using app-id/class matching, Hyprland 0.53+ syntax) +# Terminal scratchpad +windowrule = match:class ^(foot-term)$, float on +windowrule = match:class ^(foot-term)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-term)$, center on + +# Audio mixer +windowrule = match:class ^(foot-audio)$, float on +windowrule = match:class ^(foot-audio)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-audio)$, center on + +# System monitor +windowrule = match:class ^(foot-monitor)$, float on +windowrule = match:class ^(foot-monitor)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-monitor)$, center on + +# Music player +windowrule = match:class ^(foot-music)$, float on +windowrule = match:class ^(foot-music)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-music)$, center on + +# File manager +windowrule = match:class ^(foot-files)$, float on +windowrule = match:class ^(foot-files)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-files)$, center on + +# Htop +windowrule = match:class ^(foot-htop)$, float on +windowrule = match:class ^(foot-htop)$, size (monitor_w*0.6) (monitor_h*0.6) +windowrule = match:class ^(foot-htop)$, center on + +# Calculator (not a scratchpad, just launches app) bind = $mod, X, exec, qalculate-gtk bind = $mod, C, exec, qalculate-gtk -# Htop (was MODKEY+Shift+h -> sptop/htop) -bind = $mod SHIFT, H, togglespecialworkspace, htop -bind = $mod SHIFT, H, exec, [workspace special:htop] pgrep -x htop || st -t sptop -e htop -windowrule = float on, match:class ^(st-256color)$, match:title ^(sptop)$ -windowrule = size 60% 60%, match:class ^(st-256color)$, match:title ^(sptop)$ -windowrule = workspace special:htop, match:class ^(st-256color)$, match:title ^(sptop)$ - # Media/hardware keys bindel = , XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5% bindel = , XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5% |
