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.

Tuesday, October 21, 2008

Installing a Scanner

One of the nice things about being on a college campus is that you can occasionally get involved in marketing ploys promotions designed to hook you on a particular product let you know about certain nearly obsolete products.

Case in point, the Canon PIXMIA MP470 Multifunction Printer, which retails for around $100, and which the Duke Bookstore had on sale for $20. That's right, one Andy Jackson. Plus $4 for the USB2 cable.

It's not a industrial scale printer, and it's probably not a great printer for sending out lots of photos, since it's a two tank (one black, one cyan-magenta-yellow) system. But I need a printer here in North Carolina, and for $20 ...

Naturally, there were problems:

First, I couldn't get the thing to work. Something about the ink tanks not being detected by the printer. Canon technical support was fantastic (no, I am Not Making This Up). They responded to my emails within a few hours. First they sent replacement ink tanks, then they sent a replacement printer, and a UPS shipping label to return the old one. (Obviously they have learned the lesson of King Camp Gillette, who noted that it doesn't matter how much they pay for the razor, as long as they keep buying the blades. They want me to keep using this printer through lots of ink tanks.)

The new printer worked fine, with the supplied drivers, under Windows and on the Mac. Of course, that left Linux, drivers not supplied.

Fortunately we have CUPS, the Common Unix Printing System. The version of CUPS supplied with Ubuntu doesn't have a native driver for the MP470, but it does have one for the MP150, and that works. (The driver for the MP610 prints blank pages. I didn't try any of the others.)

But Wait! The MP470 isn't just a printer, it's a copier, and it's a scanner!!!! (Not, unfortunately, a dessert topping.) The scanner works fine, again with the supplied software, under Windows and on the Mac, but, again, what about Linux?

Naturally, there's software, from the SANE Project, but the version supplied with Ubuntu, 1.0.19, doesn't include the MP470. The newest version, 1.1.0, does, but it doesn't seem that it will be included in the next Ubuntu release, Intrepid (8.10).

So we're left with getting the source code for 1.1.0, and compiling it. I've done this kind of thing many times before, of course, but Nicolas has complete directions. The only change necessary for me was that I had no entry for a scanner under /etc/udev/rules.d/, so I just made one:

sudo cp tools/udev/libsane.rules /etc/udev/rules.d/71-libsane.rules

where 71 was not one of the numbers already in use in the rules.d directory. After installing the software, I had to give myself permission to use a scanner (System => Administration => Users and Groups => Properties => User Privileges) and I had to reboot – just restarting the USB services didn't work.

So now I have a scanner, as well as a printer and copier:

Scanner Test Image

Not to mention the extra tanks of Ink Canon sent me. For $24, + tax.

Saturday, October 11, 2008

Neil Gaiman at the National Book Festival

Neil Gaiman at the National Book Festival

A couple of weeks ago we went to the National Book Festival (the best thing the Bush Administration ever started) to listen to Neil Gaiman and to stand in line for three hours, getting alternately soaked and sunburned, waiting for him to sign The Graveyard Book and Neverwhere. It was worth the wait, Gaiman was extremely nice to us.

My wife says this is a really good picture, so I thought I'd share it.

Saturday, October 04, 2008

A Long Time Posting

It's been a while since I've posted here. As some of you know, I'm taking a year's Sabbatical at Duke University. You know, get away from the paperwork for awhile, and start a new line of research.

And also look around a bit. I've taken bunches of pictures, way too many to put in this blog. For those of you that are interested, go over to my home page and look at

Duke University — Part One

Hopefully more pictorials will follow.