Wednesday, 9 July 2008

Upgrading to Hardy Heron

Finally, mere months behind the rest of humanity, I have upgraded my machine at work to the latest release of Ubuntu. It's too early for any fair impressions but there is one thing that has come up that has annoyed me a great deal and I thought I'd share a solution for it. For some reason the gnome devs have seen fit to remove Multimedia tab from the Removable Drives and Media Preferences window in the Preferences menu which prevents you changing your default actions for when (for example) a CD is inserted. Strangely the icon is still CD, but that's another annoyance.

So how to make this change in Hardy? These options have been moved to the Nautilus Preferences menu (Edit -> Preferences -> Media tab) but thanks to a change in the way mime types are handled in Gnome you may well find your favourite applications are not listed in the drop down lists provided. For some reason you can't manually specify a program to run (thanks guys) so until the various package applications catch up with Gnome and this is done automatically we'll need to make changes to the application's description file.

So:
  • Go to /usr/share/applications (or /usr/share/applications/kde for a kde app)
  • sudo vi $application.desktop
  • Add the appropriate MIME types. I used this line:
MimeType=application/x-ogg;application/ogg;audio/x-scpls;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-mpegurl;application/x-flac;x-content/audio-cdda;x-content/audio-player;

(I was playing with grip in this case and there is almost certainly more than I need here, but I was in a hurry)
  • sudo update-desktop-database
  • sudo update-mime-database /usr/share/mime
Bingo. When you open Nautilus and look at the options menu you should see your application in the list.

Credits:
The solution came from here, I am merely distilling it to avoid having to hunt through pages of comments