desktop-notify-kitty
v0.2.0
Published
Pi extension that sends desktop notifications via kitten notify (kitty) or notify-send when a kitty terminal session needs attention.
Maintainers
Readme
desktop-notify-kitty
A pi extension that sends a Linux desktop notification when pi finishes an agent run and the kitty terminal window running pi is not focused.
It uses:
kitten notifyfor desktop notifications in kitty (clicking the notification jumps back to the originating window)notify-sendas a fallback for non-kitty terminalskitty @ ls --self+KITTY_WINDOW_IDfor kitty-specific focus detection- xterm focus reporting as a fallback for non-kitty terminals
Install
From npm:
pi install npm:desktop-notify-kittyOr from GitHub:
pi install git:github.com/cjrh/desktop-notify-kittyReload any already-running pi session:
/reloadTest
Inside pi:
/desktop-notify-testBehavior
The extension listens for pi's agent_end lifecycle event. When pi completes a response, it sends a notification only if the current terminal does not appear focused.
The notification includes the current project directory name and a short, truncated excerpt from the last assistant answer. Thinking/reasoning blocks, tool calls, images, and unknown content blocks are ignored.
Requirements
- Linux desktop notification service
- kitty terminal:
kitten notifyis used automatically (kitty ≥ 0.36.0) - Non-kitty terminals:
notify-sendonPATH(fallback) - kitty remote control must be available for
kitty @ ls(focus detection)
If kitty focus detection is unavailable, the extension falls back to generic terminal focus reporting.
Notes
This detects whether the terminal is focused, not whether it is merely visible on screen. On Wayland, reliable cross-compositor window visibility detection is generally not available to terminal applications.
If you already have a local copy of this extension in ~/.pi/agent/extensions/, remove or disable that copy before installing this package to avoid duplicate notifications.
