About Archive Tags RSS Feed


Blame it on rock and roll

27 November 2006 21:50

I spent a while on IRC today, rare for me, and one of the repeatable topics of conversation was showing mugshots of people in chat.

I wrote a trivial /showface command for irssi which just spawned mozilla to show a hackergotchi from planet.debian.org and that was neat.

However it suffers from the problem that you cannot spawn a graphical application from inside Screen easily. So I came up with a cunning alternative: using the DBUS notification deamon.

So now I have face.c which uses wget to download an image, then dbus to display it.

Compile it like this:

apt-get install libnotify1 notification-daemon dbus 
apt-get install libgtk2.0-dev libglib2.0-dev libnotify-dev

gcc `pkg-config --cflags gtk+-2.0` \
    `pkg-config --cflags glib-2.0` \
 face.c -lnotify -o face

Now copy the face script to drive it and you can run /showface skx and it will show you my image.

Neat hack.

(I suspect it will fail if I logout of X and restart - then reattach to screen since my DBUS identifier/session will be different. But I'm still pleased that I didn't have to quit the currently open screen session and I can make graphics appear from within it)

Update: now with caching and error detection. It will also disable itself for channels not matching ^#debian*

| No comments