dotfiles/bin/ircnotify.sh
James Gilliland 6cefafb63d Update ircnotify.sh
Avoid spawning ircnotify multiple times.
2013-05-30 14:26:09 -04:00

22 lines
487 B
Bash
Executable File

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