Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion default/agents/skills/omarchy/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ echo "Theme changed to: $THEME_NAME"
# Add custom actions here
```

Update-related hooks run as your user after Omarchy invalidates its sudo timestamp, behind the no-update wrapper. A hook that invokes `sudo` must therefore request its own explicit authorization, and Omarchy revokes the timestamp again before continuing. `post-update` runs after every sudo-capable update stage. `pre-refresh-pacman` runs after `omarchy refresh pacman` re-syncs the package config and before the package transaction, so custom repositories and `IgnorePkg` entries shape that transaction; every later privileged command still authenticates without publishing a reusable timestamp, so a detached child left behind by the hook has nothing to wait for.
Update-related hooks run as your user, but they differ in whether sudo is already authorized. `pre-refresh-pacman` runs cold, between two timestamp revocations and behind the no-update wrapper, so a hook that invokes `sudo` must request its own explicit authorization and no reusable timestamp is published; a detached child left behind by the hook has nothing to wait for. `post-update` runs inside the update's single shared sudo authorization, which mise also draws on, so a hook that invokes `sudo` there will not prompt. Only the update's own AUR phase is deliberately kept outside that authorization — `omarchy-update` revokes before `omarchy-update-aur-pkgs` and runs it behind the wrapper — but a `post-update` hook that starts AUR build tooling itself does so inside the window. `post-update` runs after every sudo-capable update stage. `pre-refresh-pacman` runs after `omarchy refresh pacman` re-syncs the package config and before the package transaction, so custom repositories and `IgnorePkg` entries shape that transaction. See `docs/update-process.md` for the full ordering.
2 changes: 1 addition & 1 deletion manual/31-dotfiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Omarchy fires hooks at a handful of moments, and you can hang your own scripts o
| `font-set` | After a font change (font name in `$1`) |
| `battery-low` | When the battery gets low (percentage in `$1`) |

The `pre-refresh-pacman` hook is where custom repositories or `IgnorePkg` lines belong, since it runs before the package transaction. Both update-related hooks run as your user after Omarchy clears its cached sudo authorization, so a hook that uses `sudo` needs its own authorization and may ask for your password.
The `pre-refresh-pacman` hook is where custom repositories or `IgnorePkg` lines belong, since it runs before the package transaction. Both update-related hooks run as your user, but they differ in whether sudo is already authorized. `pre-refresh-pacman` runs with no cached sudo authorization, so a hook that calls `sudo` may ask for your password and never leaves a reusable authorization behind. `post-update` runs inside the update's own sudo authorization, so a hook that calls `sudo` there does not prompt. The update's own AUR phase is deliberately kept outside that authorization, though anything you start from a `post-update` hook runs inside it.
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved

Each of those directories already holds a `.sample` file showing the shape of a hook — drop the `.sample` from the name to put it to work. To install a script you've written elsewhere, use `omarchy hook install post-boot ~/my-hook`, which copies it in and makes it executable.

Expand Down