Notify Crossx
Cross-platform desktop notifications for opencode — pings when run finishes or input is needed. Focus-aware, WSL + macOS + Linux. No sound by default, visual toast only.
0
53
6 in 7 days
28.8
Multi-signal model
1 month ago
2026-08-26
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-notify-crossx@0.1.0"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-notify-crossx@0.1.0"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-notify-crossxOpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
Cross-platform desktop notifications for opencode — get pinged when your run finishes or when input is needed.
Focus-aware: only pings when opencode is not the frontmost window, so you are not spammed while watching.
| Platform | Visual | Sound (off by default) | Focus check |
|---|---|---|---|
| WSL (Windows) | PowerShell Windows.UI.Notifications toast |
SystemSounds |
GetForegroundWindow |
| macOS | osascript display notification |
afplay |
System Events frontmost |
| Linux | notify-send via libnotify |
paplay |
xdotool |
No sound by default — visual toast only. Set sound: true in code to re-enable.
Install
npm i -g opencode-notify-crossx
# or for local install
npm i opencode-notify-crossx
Add to your opencode config:
~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-notify-crossx"]
}
Or project-level .opencode/opencode.json:
{
"plugin": ["opencode-notify-crossx"]
}
Restart opencode.
What triggers a ping
session.idle→ Run finishedsession.error→ Run failedpermission.updated/permission.ask→ Input needed
Debounced per session/permission to avoid spam.
Focus-aware
Only notifies when the terminal is not focused. If opencode is the frontmost window (Windows Terminal, VS Code, etc.), the ping is suppressed and logged as suppressed (focused).
To notify even when focused, edit index.js:
const CONFIG = {
onlyWhenUnfocused: false, // always ping
sound: false,
}
Sound
Off by default per user request. To enable:
const CONFIG = {
sound: true,
}
Local development (single-file plugin)
The same code also works as a single-file local plugin at ~/.config/opencode/plugins/notify.js — no npm needed. See index.js source.
How it works
isWsl()checks/proc/versionformicrosoft/wslisTerminalFocused()checks foreground window title via PowerShell on WSL/Windows, AppleScript on macOS,xdotoolon LinuxsendDesktop()triesosascript→ PowerShell toast →notify-sendin ordernotify()respectsCONFIG.onlyWhenUnfocusedandCONFIG.sound
License
MIT
Author
Davis Dey — first open source contribution, built live with opencode
Similar plugins
Simple Notify
opencode-simple-notify
Desktop notification plugin for OpenCode - works on Linux (dbus) and macOS (osascript)
Smart Notify
opencode-smart-notify
Desktop notifications for OpenCode that stay quiet when auto-approve handles the request
Alert
@chousyn/opencode-alert
Cross-platform notification plugin for OpenCode — desktop alerts, sound alerts, and webhook notifications with project-level configuration