summaryrefslogtreecommitdiff
path: root/archsetup
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-31 13:46:56 -0600
committerCraig Jennings <c@cjennings.net>2026-01-31 13:46:56 -0600
commit8d8c148ce83efe8f86037affbc7e67c3db7705cc (patch)
treec5214dd1ad18fd7f036f8d1647ae8ddfd4b92664 /archsetup
parent657d49d1589c8729d249e624ebc825ab5c161097 (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 'archsetup')
-rwxr-xr-xarchsetup19
1 files changed, 19 insertions, 0 deletions
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)