Don’t want to keep your irssi window always in front, but you need to know when messages come in? Try this cool mechanism to use the notify system to alert you (thanks to Anarcat for the helpful howto and advice!).

If you are running irssi in a screen session somewhere, you will need to first setup the irssi_proxy. If you are just running irssi locally, you will not need to do this.

Do the following commands in your irssi, changing the servers below to be IRC networks that you connect to, you can add more if you connect to more, or remove those that you aren’t using:

/load proxy
/set irssiproxy_password <secretpasswd>
/SET irssiproxy_ports indymedia=2777 oftc=2778 freenode=2779
/save

Now save the attached script to your local machine and edit it to suit your needs. You need to change the cmd variable to open a ssh tunnel to your machine, making sure that the ports that you open are the same as the ones above. You will also want to make it executable.

The system where you run irssi under screen will have to allow sshd tcp forwarding for this to work, the variable “AllowTcpForwarding yes” needs to be set in your /etc/ssh/sshd_config, if it is disabled (as it is in some cases for security reasons), you will not be able to do this in a secure way.

Now save a copy of the attached irssi notify script into your .irssi/scripts directory, and then do this:

$ cd .irssi/scripts
$ mkdir autorun
$ ln -s ../notify.pl autorun/notify.pl

You may need to modify this script for your needs. Its currently configured to not spit out notifications for the channel #emacs (you can easily add other ignores like this one), or if you get messages from ChanServ, OperServ, or NickServ (as these spit out a lot of stuff when you send them the ‘help’ command). Its also configured to do different notify urgency levels for the channel called “#nagios-status”, which you probably wont be in. This is a channel that is spitting out nagios alerts, with different severity levels, if you aren’t using nagios, or have nagios configured to do this, you can leave this alone, otherwise you will want to change this to the right channel name.

Install the packages libnotify-bin libnotify1 and test notifications by doing:

notify-send testing

You should get a box with the message displayed on your screen.

Now just run the script you downloaded earlier (irssi_proxy), which will establish some ssh tunnels to your remote irssi proxies and startup irssi locally on your own computer. Now do:

/connect localhost 2777 <password>
/connect localhost 2778 <password>
/connect localhost 2779 <password>

Each of these connect lines should connect you, over ssh, to the proxy on your irssi you have setup over screen and authenticate. If you get a connection failure, then you need to sort out your ssh forwarding.

Make sure the notify script is loaded properly:

/script 
16:16 notify          /home/micah/.irssi/scripts/notify.pl

If it doesn’t print out the notify.pl script, it didn’t load automatically, either because your symlink was wrong, or something else. You can load it manually with /script load notify.

Now try to send yourself a /msg in your screen’d irssi, you should get a notify box that pops up!