chiark / gitweb /
first cut at irssi desktop notifications
[bin.git] / irssi-notify
diff --git a/irssi-notify b/irssi-notify
new file mode 100755 (executable)
index 0000000..6827ea1
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/sh
+set -e
+
+# Based on:
+#   http://thorstenl.blogspot.com/2007/01/thls-irssi-notification-script.html
+
+ssh -n riva irssi-notify-server | \
+       sed -u 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g' | \
+       while read heading message; do
+               [ "$heading" != . ] || continue
+               notify-send -i gtk-dialog-info -t 300000 -- \
+                       "${heading}" "${message}"
+       done