examples/linux-desktop-notifications/notify-desktop.sh
raw| 1 | #!/bin/bash |
| 2 | # This is an example shell script showing how to consume a ntfy.sh topic using |
| 3 | # a simple script. The notify-send command sends any arriving message as a desktop notification. |
| 4 | |
| 5 | TOPIC_URL=ntfy.sh/mytopic |
| 6 | |
| 7 | while read msg; do |
| 8 | [ -n "$msg" ] && notify-send "$msg" |
| 9 | done < <(stdbuf -i0 -o0 curl -s $TOPIC_URL/raw) |