Thursday, October 30, 2008

Choosing Default (or null) Applications

I've been ripping a lot of CDs lately, to play on the Focus's MP3 player while I'm making the five-hour drive between Durham and Bowie East. A CD full of MP3 files plays a lot longer than an audio CD. My preferred application for ripping is grip.

Ubuntu 8.04 (Hardy Heron) has some defaults built into its gnome desktop. In particular, if you insert an audio CD, it assumes you want to play it and brings up rhythmbox, even if you already have grip running!

Annoying. And, as has been noted by others, in Ubuntu 8.04 it’s surprisingly hard to change default applications to something of your liking.

What do I want to happen when I pop in a CD? Nothing. That's right, nada, nichts, zip, /dev/null, nothing. This is Linux, right? I'll decide which program I want to run, when I want to decide it.

The aforementioned post has one suggestion: going into /etc/gnome/defaults.list and editing the appropriate lines. So I did. Since I didn't want anything to automatically happen when I inserted a CD, I deleted the lines reading:

x-content/audio-cdda=rhythmbox.desktop
x-content/audio-dvd=rhythmbox.desktop
x-content/audio-player=rhythmbox.desktop

It worked, too. When I put in an audio CD, rhythmbox didn't appear. No, sound juicer, another CD ripping program, popped up, again in parallel with my already running copy of grip.

Now I've used sound juicer. I like sound juicer. Sound juicer is no John Kennedy, but it's a good program. I just like grip better. So what to do?

The solution, my friends, lies within nautilus, Gnome's file manager. Well, somewhere in there, I can never find the appropriate menu option. However, if you try to bring up nautilus from the command line and use file completion, you find:

nau
nautilus                  nautilus-connect-server
nautilus-autorun-software nautilus-file-management-properties
nautilus-cd-burner        nautilus-sendto
$ nautilus

nautilus-file-management-properties sounds promising, so let's run it. That brings up a box that looks like this:

nautilus preference box

Two options are apparent: If you click on the box next to CD Audio, you can select the option Do Nothing. Or, you can click the box that says Never prompt or start programs on media insertion. That's what I did. And, when I insert a CD into my computer ...

Absolutely nothing happens.

Until I want it to happen.

\

Note: This works in Gnome. KDE doesn't use nautilus, so there's another program, I don't know what, to do that. Other desktops, e.g. FVWM, don't usually try to impose default behavior. You have to ask to to something special. Also, this is probably a Ubuntu default, not a general Gnome default. So YMMV, but that's the wonderfulness of Linux.

2 comments:

rcjhawk said...

Apparently I've talked about this before. I can only plead old age, in that I was born in the Truman Administration.

Bill Peter said...

Hey, looks like that will come in handy for me next week. Nice post!