Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Debian squeeze with Gnome Desktop for all my users. I have a group of machines to set up so that all users should use xpdf as a default viewer (rather than evince).

I want this set up to be done by command line (even better, using puppet).

I know about xpg-mime command, but the man page says that the default command should not be used as root.

I could manually tweak the /etc/gnome/defaults.list files, but I'm looking for a single command I could run to perform the setting without an editor interaction.

Any ideas?

share|improve this question

Well, Linux defaults are set by editing text files. I doubt you can avoid that. You can however automate it. The following sed command will change /etc/gnome/defaults.list in the way that you need:

sed -i '/pdf/s/evince./xpdf./g' 
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .