os-notifier # os-notifier Know when Pi finishes work or needs your decision while its terminal is in the background. ## Use it in Pi Nothing to invoke. Start a direct interactive Pi request, switch to another window, then return when your OS notification says Pi finished or needs input. Notifications appear only for interactive TUI work that began from your input while Pi is unfocused. Pi stays quiet for focused work and non-interactive, SDK, extension-driven, or subagent-style turns. A request from an extension UI can also trigger a notification when it is waiting for your answer. Linux uses `notify-send`, macOS uses Notification Center, and Windows uses a PowerShell toast when available. The Termux delivery backend uses `termux-notification` and a separate 500 ms `termux-vibrate`, respecting silent mode. ### Termux setup Install the `termux-api` CLI package and [Termux:API app](https://github.com/termux/termux-api) from the same source as Termux. Enable Android notifications for Termux:API; silent mode and Do Not Disturb can suppress vibration. Missing CLI, API failures, and timeouts produce actionable Pi warnings, deduplicated per session. Android can silently suppress notifications even when the CLI reports success. A bundled Android focus helper runs only when an eligible turn finishes or asks for input, not during startup or through polling. It only reads Termux focus; it never switches apps or takes focus. Unfocused Termux receives a notification and direct vibration; focused Termux stays quiet. Unknown focus, runtime failures, or unsupported Android versions suppress alerts with a deduplicated warning. The helper uses Android's built-in runtime; Java and D8 are not required on your device. Focus detection was verified on Android 17 / API 37; screen lock, multi-window, and other Android versions remain unverified. On first use, Pi removes write permissions from its own bundled JAR because Android rejects writable DEX files. If background delivery stalls, check Android battery restrictions for Termux and Termux:API. If native delivery fails, Pi tries a terminal notification instead. Completion notices can include a shortened prompt, project name, branch, session name, model, duration, and failure detail. Treat lock-screen or desktop notifications as visible to anyone who can see your desktop. Install through [Installation](../../README.md#install). [Changelog](./CHANGELOG.md).