Growl notifications with irssi

One thing that I've been wanting is to get Growl notifications from irssi, which I'm running on a remote server, as I do when using, e.g., Colloquy. By googling a little I found this great write up on how to enable growl notifications. 

First you need to get the 'fnotify.pl' script from here which writes to a file every time anyone is messaging you or anything that you have chosen to /hlight, We also need 'growlnotify' which is in Growl's dmg extras folder.

  1. Put growlnotify in your path. I use my ~/bin folder.
  2. Copy the 'fnotify.pl' to the remote server's ~/.irssi/scripts folder (make a scripts folder if it does not exists)
  3. Finally, put this script below into your path. I use my ~/bin folder. It connects to the remote server and tails the pnotify file which is then piped back to the client which does the notification using growlnotify.
#!/bin/bash
 (ssh myuser@irssi-remote-server -o PermitLocalCommand=no  \
     ": > .irssi/fnotify ; tail -f .irssi/fnotify " | \
   while read heading message; do                    \
     growlnotify -t "${heading}" -m "${message}";     \
   done)& 

There is one hitch though, if the connection to the server is closed the command does not exit. So the next time I logon I'll have two processes runnning...

 

Tags: 

Add new comment

Plain text

  • No HTML tags allowed.
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.