Bind the Stay Awake indicator to the idle service

The indicator polled omarchy-toggle-idle over a Process and re-ran it on
a timer to toggle, while the CLI called back into the shell over IPC to
apply and refresh the state it had just changed. Now the indicator binds
straight to the idle service's stayAwake property and flips it in
process. The CLI only touches the state file, which the service already
watches, so toggling from keybindings and scripts still reaches the
shell without any reentrant IPC.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-07-21 15:25:49 -07:00
co-authored by Claude Fable 5
parent 51d6d3c291
commit bee9ab476c
4 changed files with 35 additions and 42 deletions
-4
View File
@@ -33,15 +33,11 @@ apply_state() {
stay-awake)
mkdir -p "$STATE_DIR"
touch "$STATE_FILE"
omarchy-shell -q idle disable
;;
allow-idle)
rm -f "$STATE_FILE"
omarchy-shell -q idle enable
;;
esac
omarchy-shell -q omarchy.indicators refresh
}
case "${1:-toggle}" in