23 lines
997 B
Bash
23 lines
997 B
Bash
#!/usr/bin/env bash
|
|
# =============================================================================
|
|
# Hook: Desktop Notification (Notification event)
|
|
# =============================================================================
|
|
# Sends a macOS/Linux desktop notification when your agent platform needs attention.
|
|
# Useful during long agent chains that can take several minutes.
|
|
#
|
|
# macOS: uses osascript (built-in)
|
|
# Linux: uses notify-send (install with: sudo apt install libnotify-bin)
|
|
# =============================================================================
|
|
|
|
INPUT=$(cat)
|
|
TITLE=$(echo "$INPUT" | jq -r '.args.title // "Second Brain Crew"' 2>/dev/null)
|
|
MESSAGE=$(echo "$INPUT" | jq -r '.args.message // "Your obsidian crew needs your attention"' 2>/dev/null)
|
|
|
|
if [[ "$(uname)" == "Darwin" ]]; then
|
|
osascript -e "display notification \"$MESSAGE\" with title \"$TITLE\"" 2>/dev/null
|
|
elif command -v notify-send &>/dev/null; then
|
|
notify-send "$TITLE" "$MESSAGE" 2>/dev/null
|
|
fi
|
|
|
|
exit 0
|