chiark / gitweb /
pull-mail: add --force option; extend running times
[bin.git] / irssi-notify
index 6827ea19a39be40a2987226e10d9178547073640..de6acf713c113d774af1d8460869e160f6d98956 100755 (executable)
@@ -5,9 +5,24 @@ set -e
 #   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' | \
+       sed -u 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/\\/\\\\/g' | \
        while read heading message; do
-               [ "$heading" != . ] || continue
-               notify-send -i gtk-dialog-info -t 300000 -- \
-                       "${heading}" "${message}"
+               case $heading in
+                       .)
+                               continue
+                               ;;
+                       LPBUG)
+                               bug="${message%% *}"
+                               message="${message#* }"
+                               imp="${message%% *}"
+                               message="${message#* }"
+                               notify-send -i gtk-dialog-info -t 0 -- \
+                                       "New LP bug $bug ($imp)" \
+                                       "<a href=\"https://launchpad.net/bugs/$bug\">$message</a>"
+                               ;;
+                       *)
+                               notify-send -i gtk-dialog-info -t 30000 -- \
+                                       "${heading}" "${message}"
+                               ;;
+               esac
        done