Documentation
¶
Overview ¶
Package notify — OS desktop notifications for the office: a look-away nudge when a permission ask blocks the floor or the boss's turn lands while the terminal is unfocused.
Zero NEW dependencies, same shape as internal/sound/player.go: a resolved platform binary, fire-and-forget exec, and total fail-silence (no binary, a non-zero exit, or a wedged process all degrade to nothing — the office must never break because a notification daemon did).
- darwin: osascript -e 'display notification "<body>" with title "<title>" sound name "Glass"'
- linux: notify-send <title> <body> ("permission" kind rides -u critical)
- other / not found: resolve to "" — every Send is a graceful no-op.
CLICK-TO-FOCUS IS NOT AVAILABLE without new deps: AppleScript's `display notification` carries NO click action (Notification Center click actions need a bundled .app + UNUserNotificationCenter), and notify-send action hints are desktop-environment flavored. The banner is a pure heads-up — the member's way back stays the terminal bell + the in-app [blocked] surfacing (the sound bus, untouched).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveNotifier ¶
func ResolveNotifier() string
ResolveNotifier finds the platform notifier, or "" when none exists.
- darwin: osascript
- linux: notify-send
- other: none
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus routes look-away nudges to the OS notification daemon. Modes:
"on" — fire through the resolved platform notifier "off" — silence
Env override: THEFLOOR_NO_NOTIFY=1 forces "off" above whatever config asked for.
func NewBus ¶
NewBus builds a Bus for the config mode ("on"|"off"|""). "" defaults to "on"; anything unrecognized turns OFF — a brain.json typo must never spam the desk. The notifier lookup happens once here; an empty resolution keeps every Send a graceful no-op.
func (*Bus) NotifierPath ¶
NotifierPath returns the resolved notifier command path, or "" if none.