Support multiple post update hooks (example usage scripts)#5242
Support multiple post update hooks (example usage scripts)#5242markmcnaughton wants to merge 5 commits intobasecamp:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds documentation and example scripts for supporting multiple post-update hooks through an optional pattern using a post-update.d/ directory. The pattern allows users to organize multiple post-update scripts in a predictable, sortable convention without modifying the core omarchy-hook or omarchy-update-perform scripts.
Changes:
- Documents an optional post-update hook pattern using an explicit
LC_ALL=C sortfor deterministic execution order with numeric-prefixed script names - Provides ready-to-uncomment bash code in
post-update.samplethat iterates through executable scripts in~/.config/omarchy/hooks/post-update.d/, handling empty directories withnullgloband reporting failures without stopping the execution chain - Adds two minimal example hook scripts demonstrating valid bash structure and how to conditionally run desktop notifications
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| config/omarchy/hooks/post-update.sample | Adds commented-out example code showing how to run multiple hooks from a directory with sorted execution and error handling |
| config/omarchy/hooks/post-update.d/10-my-post-update-task-1.sample | Example hook script demonstrating the first task pattern with notify-send usage |
| config/omarchy/hooks/post-update.d/20-my-post-update-task-2.sample | Example hook script demonstrating the second task pattern with consistent structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Accepted suggestion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Documents an optional pattern for running several scripts after an Omarchy update by using a
post-update.d/directory, and adds example drop-in hooks so users can copy and adapt them.Motivation
omarchy-hook post-updatestill runs a single executable at~/.config/omarchy/hooks/post-update. Users who want more than one post-update action (notifications, backups, package tweaks, etc.) benefit from a small, predictable convention: executable scripts inpost-update.d/, run in lexicographic order by path using an explicitLC_ALL=C sort(not raw glob order, which is not guaranteed sorted), without changingomarchy-hookitself.What changed
config/omarchy/hooks/post-update.sample— Comments describe optional use of~/.config/omarchy/hooks/post-update.d/and include a ready-to-uncomment loop that:nullglobso an empty directory does not leave a stray*path;mapfile+printf+LC_ALL=C sort) so numeric prefixes like10-and20-run in a stable order;-fand-x), logs each script, and reports failures without stopping the rest of the chain.config/omarchy/hooks/post-update.d/— Example scripts (10-my-post-update-task-1.sample,20-my-post-update-task-2.sample) demonstrate minimal valid bash hooks (e.g. desktop notifications), consistent with other*.samplehooks in this repo.How to use (for reviewers / release notes)
~/.config/omarchy/hooks/as usual.post-update.sample→post-updateand, if you want multiple hooks, uncomment thepost-update.dblock in that file.~/.config/omarchy/hooks/post-update.d/if needed, copy examples, remove the.samplesuffix, andchmod +xthe scripts you want to run.No changes to
bin/omarchy-hookoromarchy-update-performare required for this pattern.Checklist
shellcheck(if you run it in CI).