Friday, June 20, 2008

irssi notifications over Jabber (or IRC barking)

Thanks to daubers (the brains behind the XMPP doorbell) who suggested it, I now have irssi highlights sent directly to my Jabber client. Quite a handy thing since only yesterday I logged in to find several PMs awaiting me from 4 days ago.

For the base I used an existing irssi script called fnotify, which was designed to write notifications to a file. I found this script from Aaron Toponce's blog post.


mkdir -p ~/.irssi/scripts/autorun
cd ~/.irssi/scripts
wget http://www.leemhuis.info/files/fnotify/fnotify -O fnotify.pl
chmod +x fnotify.pl
ln -s ../fnotify.pl autorun/fnotify.pl
nano fnotify.pl


Change line 56 (which reads something like open(FILE, ...)) to:


open(FILE,"| sendxmpp -i me\@example.com");


Replace the JID with your own, and make sure to put a \backslash before the @ sign as above.

sudo apt-get install sendxmpp


When it is installed, tell sendxmpp what account to use for sending messages:


echo me@example.com verysecret123 > ~/.sendxmpprc
chmod 0600 ~/.sendxmpprc


Replace with your JID and password of course ;)

Now, in irssi:

/win 1
/run fnotify.pl

(switching to window 1 is necessary to see any error messages if they appear)

If it loads successfully, get someone to say your nick or send you a private message. It should appear in your Jabber client within a few seconds.

A consequence of this for me is that IRC now barks too :)

2 comments:

Paul said...

So your cyberdog must be barking a lot now... Too bad it can only bark "monotone" :D -- could become annoying.

Anonymous said...

Why not just use Irssi for IRC and Jabber, just use irssi-xmpp plugin.