From 67b5cfdcce125cd90088bacb33f158862e899b37 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 30 Apr 2008 16:04:49 +0000 Subject: [PATCH] first cut at irssi desktop notifications --- irssi-notify | 13 +++++++++++++ irssi-notify-server | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 irssi-notify create mode 100755 irssi-notify-server diff --git a/irssi-notify b/irssi-notify new file mode 100755 index 0000000..6827ea1 --- /dev/null +++ b/irssi-notify @@ -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/&/\&/g; s//\>/g' | \ + while read heading message; do + [ "$heading" != . ] || continue + notify-send -i gtk-dialog-info -t 300000 -- \ + "${heading}" "${message}" + done diff --git a/irssi-notify-server b/irssi-notify-server new file mode 100755 index 0000000..27eba2f --- /dev/null +++ b/irssi-notify-server @@ -0,0 +1,25 @@ +#! /bin/sh +set -e + +# Based on: +# http://thorstenl.blogspot.com/2007/01/thls-irssi-notification-script.html + +FNOTIFY="$HOME/.irssi/fnotify" +TAIL= + +cleanup () { + rm -f "$FNOTIFY" + if [ "$TAIL" ]; then + kill "$TAIL" + fi +} +trap cleanup EXIT HUP INT QUIT PIPE TERM + +tail -n 10 "$FNOTIFY" 2>/dev/null || true +> "$FNOTIFY" +tail -f "$FNOTIFY" & +TAIL="$!" +while :; do + echo . + sleep 5 +done -- 2.30.2