feat: add desktop notification hook script (#664)
This commit is contained in:
17
hooks/desktop-notification.sh
Executable file
17
hooks/desktop-notification.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# Send desktop notification using osascript (macOS)
|
||||
|
||||
input=$(cat)
|
||||
message=$(echo "$input" | jq -r '.message')
|
||||
level=$(echo "$input" | jq -r '.level')
|
||||
|
||||
# Display the notification (show subtitle only for warning/error)
|
||||
if [ "$level" = "error" ]; then
|
||||
osascript -e "display notification \"$message\" with title \"Letta Code\" subtitle \"Error\""
|
||||
elif [ "$level" = "warning" ]; then
|
||||
osascript -e "display notification \"$message\" with title \"Letta Code\" subtitle \"Warning\""
|
||||
else
|
||||
osascript -e "display notification \"$message\" with title \"Letta Code\""
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user