June 17th, 2009
This morning I learned some new stuff. That’s always fun.
I have a Logitech Harmony remote control. This is one of those smart ones which can be programmed to control just about anything, and control multiple things to do a single ‘operation’ (e.g. I can press the ‘watch TV’ button, and it switches on my cable box, my TV and my amp, and switches the amp and the TV to the appropriate input settings). Neat stuff. It’s programmed via a web interface, which sends out little files containing firmware updates or instruction sets or whatever, which then have to get uploaded to the remote. Of course, Logitech only supply a Windows program to do this.
There is Linux support, in the form of the fine Concordance project, which provides libconcord (that does all the heavy lifting), concordance (a console UI) and congruity (a GUI). So we’re close to remote control nirvana, defined as the point where you just run the web interface as you would on Windows, and when it sends you one of the little files to get uploaded to the remote, congruity kicks in and handles it.
However, there were two problems. One, the stuff was only actually working as root – concordance and congruity couldn’t see the remote when run as normal user. I filed a bug report on that and it got fixed in short order – thanks to the maintainer (Douglas Warner) for that. Two, there was no handling of the file types involved – they’re XML files with the extensions .EZHex, .EZTut and .EZUp – so you had to make sure Firefox was set to manually ask you what to do with every file (or else it’d just figure they were XML and try and open or save them), and then manually associate these types with congruity. Which sucked.
So, what I learnt is the freedesktop.org shared mime information policy, and a highly fascinating policy it is! How it helps us in this case is it tells us how to define a MIME type for a file based on its extension. Basically you stick a little XML file in /usr/share/mime/packages which tells it that any file with the extension .EZHex, .EZUp or .EZTut is of MIME type application/x-libconcord . So I wrote up a patch for upstream libconcord to make it include and install such a file, and submitted it to our Bugzilla and to upstream concordance. Once that’s done, we can just ship a congruity package (it’s been stuck in review hell for a year, I’ll try and get that sorted out) with a .desktop file saying it handles the application/x-libconcord MIME type, and remote control nirvana will be ours – all you’ll need to do is install the congruity package and you’ll be able to use the Harmony web programming interface with no messing about. Ahh, I like it when I can do useful stuff.