2011-11-12 21:45:53 -05:00
|
|
|
#!/bin/zsh
|
|
|
|
notify()
|
|
|
|
{
|
|
|
|
heading=$1
|
|
|
|
message=$2
|
|
|
|
if [ `uname` = "Darwin" ]; then
|
|
|
|
growlnotify -t ${heading} -m ${message}
|
|
|
|
else
|
|
|
|
notify-send ${heading} ${message}
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2013-05-30 14:26:09 -04:00
|
|
|
# Avoid spawning script twice.
|
|
|
|
ps aux | grep ircnotify.sh | grep -v grep | grep -v $$ && exit
|
|
|
|
|
2011-11-12 21:45:53 -05:00
|
|
|
(ssh irc.walkah.net -o PermitLocalCommand=no \
|
|
|
|
": > .irssi/fnotify ; tail -f .irssi/fnotify " | \
|
|
|
|
while read heading message; do \
|
|
|
|
notify "${heading}" "${message}"; \
|
|
|
|
done)&
|
|
|
|
|