Irssi and notifications in Gnome 3/Shell

I decided to switch over full time to Irssi, as Xchat and Xchat-gnome on Gnome 3 had become too frustrating.

I installed the package from the Mint repos. Irssi is terminal-based IRC client, so the first thing I wanted was to enable notifications. Some Googling led me to this script.

To install an Irssi script you create a scripts directory in ~/.irssi/. You put the script in there. In Irssi you type

/script load notifiy.pl

If you want to make this load automatically each time you launch Irssi you create another directory inside scripts called autorun. Inside autorun you create a link to the script you want to load automatically.

ln -s ../notify.pl .

I wanted Irssi to notify all messages, not just ones highlighted for me. To do this I had to change the script a little bit. In the line

return if (!$server || !($dest->{level} & MSGLEVEL_HILIGHT));

I changed the message level (type /HELP levels in Irrsi to find out more about message levels)

return if (!$server || !($dest->{level} & MSGLEVEL_<mark>PUBLIC</mark>));

and reloaded the script. Every message was now notified.

There was an issue though with the notifications stacking up in the tray. To stop this I found the section

my $cmd = "EXEC - notify-send" . " -i " . Irssi::settings_get_str('notify_icon') . " -t " . Irssi::settings_get_str('notify_time') . " -- '" . $summary . "'" . " '" . $message . "'";

and added the line --hint=int:transient:1

my $cmd = "EXEC - notify-send" . " -i /usr/share/irssi/icons/icon.png" . " -t " . Irssi::settings_get_str('notify_time') . " --hint=int:transient:1" . " -- '" . $summary . "'" . " '" . $message . "'";

The last thing I wanted to do was change the icon that displayed in the notification area from the default Gnome light bulb. I got the Irssi logo from their site and whipped out the Gimp. By removing the text part of the logo and changing the colour of the flame (the black wasn't showing up on the notification background) I was left with this

custom Irssi logo

I created an icons directory in /user/share/irssi/ and put this in there as icon.png.

To set this as the icon used by the script I had to remove the line

Irssi::settings_add_str('notify', 'notify_icon', 'gtk-dialog-info');

and change

" -i " . Irssi::settings_get_str('notify_icon') .

to this

" -i /usr/share/irssi/icons/icon.png" .

The new icon looks really cool:

new icon in action

You can find more info on configuring Irssi at ArchWiki