Remote Highlight Notifications with IRSSI
Running IRSSI remotely has many advantages. You can just login and logout of your screen session without having to miss any of the constant stream of nonsense that your IRC channels are filled with, for example. You can also pick up an SSH client and continue your IRC session no matter where you are.
One thing that isn't so great about running your sessions remotely is notifications. If you're running IRSSI locally in an xterm, there are several solutions to get libnotify popups to show up whenever a highlighted word is show. I use a variant of the hilightwin.pl script.
Running IRSSI remotely, I've changed the script a little bit. Instead of popping up a libnotify bubble, it pings a local XMLRPC service with the highlight information:
$server_url = 'http://qnap.local:8000/RPC2';
$server = Frontier::Client->new(url => $server_url);
$result = $server->call('add_message', (@args));
The XMLRPC service keeps a list in memory of notifications, and makes them available to remote method calls, like num_messages and next_message.
On the local machine, I run a python XMLRPC client. It polls the XMLRPC service, and uses the libnotify python bindings to pop up a message whenever there's a highlight.
This is unbelievably insecure, of course. There should probably be some sort of authentication going on, yes, but I run it on an internal network, accessible via VPN, so I have my notifications without too much worry.
So now I leave my IRC session running in a screen on my little ARM server, which I can login to remotely without sacrificing my notify bubbles.
Some stuff I'm planning on adding:
-
A systray- or indicator-style applet that shows the last /x/ number of highlights
-
Notifications from applications other than IRSSI
-
Idle detection on the client, so I can run multiple notify clients without worrying about them stepping on each other's RPC traffic