From 8d8c148ce83efe8f86037affbc7e67c3db7705cc Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 31 Jan 2026 13:46:56 -0600 Subject: 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 --- dotfiles/hyprland/.local/bin/stash-restore | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'dotfiles/hyprland/.local/bin/stash-restore') 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 -- cgit v1.2.3