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 --- archsetup | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'archsetup') diff --git a/archsetup b/archsetup index 13abac9..f92e58e 100755 --- a/archsetup +++ b/archsetup @@ -1449,6 +1449,25 @@ hyprland() { action="enabling hy3 plugin" && display "task" "$action" (sudo -u "$username" hyprpm enable hy3 >> "$logfile" 2>&1) || \ error "warn" "$action" "$?" + + # Pacman hook to rebuild plugins after Hyprland updates + # Prevents plugin version mismatch that causes plugins to fail loading + action="creating hyprpm pacman hook" && display "task" "$action" + mkdir -p /etc/pacman.d/hooks + cat > /etc/pacman.d/hooks/hyprpm.hook << 'HOOKEOF' +[Trigger] +Operation = Upgrade +Type = Package +Target = hyprland + +[Action] +Description = Rebuilding Hyprland plugins after update... +When = PostTransaction +Exec = /usr/bin/runuser -u ARCHSETUP_USERNAME -- /usr/bin/hyprpm update --no-shallow +HOOKEOF + # Replace placeholder with actual username + sed -i "s/ARCHSETUP_USERNAME/$username/" /etc/pacman.d/hooks/hyprpm.hook + chmod 644 /etc/pacman.d/hooks/hyprpm.hook } ### Display Server (conditional) -- cgit v1.2.3