The universe is possible

This commit is contained in:
2026-05-31 17:35:29 +05:30
parent 55d2d244dd
commit 782257820c
6 changed files with 40 additions and 53 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
#!/bin/sh
notify () {
notify() {
notify-send -i "$icon_path" -e -h "string:x-canonical-private-synchronous:${0##*/}" "[$1] ${2}" "$3"
}
@@ -15,7 +15,7 @@ icon_path="$(dirname "$0")/ntfy.png"
trap "ntfy_creds unload" EXIT
trap "ntfy_creds unload; exit 1" INT HUP
websocat --no-close "wss://${NTFY_URL#https://}/$NTFY_TOPIC_LISTEN/ws?auth=$token" | while IFS= read -r line; do
websocat --no-close "wss://${NTFY_URL#https://}/$NTFY_TOPIC_LISTEN/ws?auth=$token" | while IFS= read -r line; do
title=$(printf '%s' "$line" | sed -nE 's|.*,"title":"([^"]*)",.*|\1|p')
topic=$(printf '%s' "$line" | sed -nE 's|.*,"topic":"([^"]*)",?.*|\1|p')
message=$(printf '%s' "$line" | sed -nE 's|.*,"message":"([^"]*)",.*|\1|p')