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 :)

Monday, June 16, 2008

IM Barking

Over the weekend my brother found an old toy of his... a "robotic" dog. It has two functions, walking and "barking" (where bark is more of a squeak). Unfortunately the controller for these said functions had been put beyond practical repair by leaked batteries. I cut the controller off and wondered what uses I could put the thing to. A solution looking for a problem.

People often complain that I don't respond to their Jabber messages, often this is because I simply didn't notice it, or wasn't at my computer. I do have speakers, but I either have music playing, or when not, they are turned down to 0. Problem found.

To replace the dog's original controller I used a USB interface board. It wasn't long before I knocked together a quick Lua script to use the board and make it bark on demand.

With thanks to vArDo (Mateusz BiliƄski, working to add a plugin system to Gajim for GSoC 2008) for the D-BUS notification handler script, I managed to link up new message arrivals to the barking. The result? See for yourself: