I just switched from the Konversation IRC client to the terminal based IRSSI. I'm starting IRSSI on a remote machine using GNU screen + SSH. I do not get any sound notification on new messages, which means that I've to check out IRSSI once in a while for new messages.
That's not really productive, so I'm looking for an application / script that plays a sound (preferably /usr/share/sounds/KDE-Im-Irc-Event.ogg
and not the annoying beep) on my machine if there is any activity. It would be great if I can disable the notification for certain channels.
Or, if that's not possible, some sort of notification via libnotify
, thus making it available to GNOME and KDE.
I did not like libnotify, so I created an UDP server in Python and a client application for irssi. Note that this answer applies to the original requirements in revision 1, it does not have text notification.
Client
This version reacts to various messages directed at you. If you would like to be notified of messages in any channel, remove the leading
#
in the#'message public'
line. Some rate-limiting is implemented, there will be at least 1.3 seconds delay between notifications.Server
When started, it listens on all addresses, port 3533. If it receives a UDP packet "M", it plays
/usr/share/sounds/KDE-Im-Irc-Event.ogg
usingpaplay
("PulseAudio play"). On receivingS
, it quits the server. Since it's open-source, you are free to remove this.The sequence of starting the remote server becomes:
After logging in, I run:
Should you need to reconnect later:
After starting
irssi
, you need to set the host and port:To make it connect automatically on startup:
The first time, you need to start Notify UDP manually since it was not auto started yet:
In order to test the notification:
To-do:
I do this with libnotify. I found this ages ago.
It works like a champ. I used to use it with libnotify on linux (and still do when I'm on a linux machine) but most of the time I'm on a macbook now, so I use growl as a replacement for libnotify on the mac.
To load it in
irssi
, run the following:/load perl
/script load fnotify
Then, we need to get it routed to
libnotify
. To do that, save the following as a shell script and run it on login: