diff options
| author | Craig Jennings <c@cjennings.net> | 2026-01-31 13:46:56 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-01-31 13:46:56 -0600 |
| commit | 8d8c148ce83efe8f86037affbc7e67c3db7705cc (patch) | |
| tree | c5214dd1ad18fd7f036f8d1647ae8ddfd4b92664 /dotfiles | |
| parent | 657d49d1589c8729d249e624ebc825ab5c161097 (diff) | |
fix(hyprland): auto-rebuild plugins and preserve stash master position
- Add pacman hook to rebuild hyprpm plugins after Hyprland updates
- Change startup to hyprpm update -n (rebuilds if needed)
- Fix stash-restore to preserve master window using batch commands
- Add validation tests for plugins and hyprpm hook
Diffstat (limited to 'dotfiles')
| -rw-r--r-- | dotfiles/hyprland/.config/hypr/hyprland.conf | 2 | ||||
| -rwxr-xr-x | dotfiles/hyprland/.local/bin/stash-restore | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/dotfiles/hyprland/.config/hypr/hyprland.conf b/dotfiles/hyprland/.config/hypr/hyprland.conf index dfbb49e..78c5bdf 100644 --- a/dotfiles/hyprland/.config/hypr/hyprland.conf +++ b/dotfiles/hyprland/.config/hypr/hyprland.conf @@ -17,7 +17,7 @@ exec-once = systemctl --user start xdg-desktop-portal-hyprland xdg-desktop-porta # Core services exec-once = /usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh exec-once = dunst > ~/.local/var/log/dunst-$(date +%Y-%m-%d-%H%M%S).log 2>&1 -exec-once = [ -n "$(hyprpm list 2>/dev/null)" ] && hyprpm reload; sleep 2 && hyprctl dismissnotify -1 +exec-once = hyprpm update -n && sleep 2 && hyprctl dismissnotify -1 # Desktop appearance (after portal is ready) exec-once = swww-daemon && sleep 1 && swww img ~/pictures/wallpaper/trondheim-norway.jpg diff --git a/dotfiles/hyprland/.local/bin/stash-restore b/dotfiles/hyprland/.local/bin/stash-restore index e04945a..ddaa5a4 100755 --- a/dotfiles/hyprland/.local/bin/stash-restore +++ b/dotfiles/hyprland/.local/bin/stash-restore @@ -1,10 +1,18 @@ #!/bin/bash # Restore all windows from special:stash to current workspace +# Preserves current master window position using batch commands workspace=$(hyprctl activeworkspace -j | jq -r '.id') +original_focus=$(hyprctl activewindow -j | jq -r '.address') -# Get all windows in special:stash and move them to current workspace -hyprctl clients -j | jq -r '.[] | select(.workspace.name == "special:stash") | .address' | \ -while read -r addr; do - hyprctl dispatch movetoworkspacesilent "$workspace",address:"$addr" +# Get all windows in special:stash +stashed=$(hyprctl clients -j | jq -r '.[] | select(.workspace.name == "special:stash") | .address') + +if [ -z "$stashed" ]; then + exit 0 +fi + +# Restore each window, then swap original back to master (batched for atomicity) +for addr in $stashed; do + hyprctl --batch "dispatch movetoworkspacesilent $workspace,address:$addr ; dispatch focuswindow address:$original_focus ; dispatch layoutmsg swapwithmaster master" done |
