Growl, IRC, and Irssi
Growl, for those who don’t know, is a handy utility for Mac OS-X that lets applications unobtrusively display notifications on the screen. Many applications have buil-in support for popping messages up via Growl. One handy use is when an IRC or IM application receives a message for you but the application is minimized. You wouldn’t see the message if the app is minimized, but with Growl the application can pop up a message on the screen.
Irssi is a highly customizable IRC client – it calls itself “the client of the future”. One of the many features of Irssi is that you can customize it with perl scripts, and you can find literally hundreds of perl scripts for Irssi with very little effort.
As a professional systems administrator I need to have remote access to the systems I manage, as well as the ability to communicate with my fellow admins. We run an IRC server that lets us chat with each other whether in the office or remotely. I could run an IRC client on my Mac at work but the problem with that is accessing it remotely. Interacting with the desktop remotely is painfully slow, and a text-based IRC client like Irssi in conjunction with a utility like screen lets me keep my client logged into IRC and allows me to access it from virtually anywhere at any time. Most of us also opt to run our IRC clients on a shell server rather than our own desktop systems since the servers are more easily accessible, and less likely to go down due to hardware problems, power failures, etc.
So on my Mac at work I run Irssi in a screen session on a linux server. The problem is that I can miss important messages if I don’t keep an eye on the Irssi session, and as any sysadmin will tell you it’s very easy to get distracted.
I have found a few solutions that hook a remote Irssi session into Growl on your Mac desktop, but none of them had quite the features that I wanted. So I ended up writing my own, in part to learn a little about Growl & Irssi, and in part to give me those features I desired. Everything I’ve written can be downloaded from the link below, and it’s all covered by the GPL so feel free to use and modify it as long as you adhere to the GPL.
Features
There were three primary features I was interested in. The first was that the client and server communicate via TCP so that I could use port forwarding in SSH to ensure a secure connection between Irssi and Growl. The second was that if I didn’t want to rely on an SSH tunnel that the datastream could be optionally encrypted to ensure a secure connection. Encryption is performed using Blowfish, and to enable it you just specify an encryption key in the configuration file. If you don’t want to use encryption just comment out the encryption key.
The third feature is that the Irssi integration allow me to specify arbitrary text that would trigger Growl popups. I want Growl to notify me if somebody mentions certain key words or phrases in IRC. My Growl module allows you to easily add and remove arbitrary strings that will trigger Growl popups so that I can add and change them as desired.
Another feature not related to Irssi that I decided would be handy was to extend it so that I could easily add it to any other environments where I might want remote Growl messages. To that extent I wrote a command line utility that also lets you send Growl messages, and it supports the same features as the Irssi module.
The scripts should be extremely easy for anybody with minimal perl experience to install. They do require a number of perl modules, such as the Mac::Growl module that interfaces with Growl, as well as Crypt::CBCeasy for Blowfish encryption and a few others. See the README file for a complete list of all the modules.
Usage
The README file has complete instructions, but in a nutshell:
- Install the appropriate perl modules on both the client and the server
- Create the file ~/.growl-server on your Mac with the desired options (see the comments in the included sample)
- Run growl-server.pl on your Mac
- Place growl.pl in your ~/.irssi/scripts directory on the system where you run Irssi
- Edit growl.pl and modify any of the documented options to match those in ~/.growl-server
- Load the growl script into Irssi
Optionally, or if you just want to use the command line utility to send Growl messages:
- Create the file ~/.send-growl on the system that will be sending Growl messages
- Copy send-growl.pl to the system
- Run send-growl.pl (use -? or –help to see command line options)
Download remote-growl-0.01.tar.gz here.