Browse Source

Update send-notification

Samuel W. Flint 5 years ago
parent
commit
22fd43e2a4
1 changed files with 16 additions and 6 deletions
  1. 16 6
      send-notification

+ 16 - 6
send-notification

@@ -1,8 +1,18 @@
 #!/bin/sh
 
-twmnc "$1"
-curl -s \
-     -F "token=acioo737xpg83udi17sdsevmjox5eg" \
-     -F "user=u4wih2x18os74469f6zj9jggd7mbon" \
-     -F "message=\"$1\"" \
-     https://api.pushover.net/1/messages.json
+if [ $# -eq 2 ] ; then
+    twmnc -t "$2" -c "$1"
+    curl -s \
+         -F "token=acioo737xpg83udi17sdsevmjox5eg" \
+         -F "user=u4wih2x18os74469f6zj9jggd7mbon" \
+         -F "message=\"$2\"" \
+         -F "title=\"$1\"" \
+         https://api.pushover.net/1/messages.json
+else
+    twmnc -c ""$1
+    curl -s \
+         -F "token=acioo737xpg83udi17sdsevmjox5eg" \
+         -F "user=u4wih2x18os74469f6zj9jggd7mbon" \
+         -F "message=\"$1\"" \
+         https://api.pushover.net/1/messages.json
+fi