current
#!/usr/bin/env zsh
host="$1"
summary="$2"
body="$3"
if [ -z "$host" ] || [ "$host" = "self" ]; then
host=$(myhostname)
fi
if [ -z "$summary" ]; then
summary="done"
fi
if [ "$host" = "$(myhostname)" ]; then
notify-send "$summary" "$body" &
pw-play /usr/share/sounds/freedesktop/stereo/complete.oga &
wait
else
if timeout 2 ssh-add -l &> /dev/null; then
ssh "$host" "A ${(q)host} ${(q)summary} ${(q)body}"
else
curl -H "Title: $summary" -d "$body" "$MY_ALERT_URL" &> /dev/null
fi
fi