PCs

SolutionBase: Get a handle on GNOME settings with Gconf-edit

By Jack Wallen

This article is also available as a TechRepublic download.

If you want to create an image CD to use to setup large numbers of client machines, having to go through every single application to set up preferences could easily be a full-time job in itself. What if you have hundreds of desktop machines, and each of them need changes made to desktop settings? What do you do?

The GNOME configuration tool, Gconf, aggregates thousands of user settings in one location. For every application installed, for every possible desktop setting, Gconf works as the front end, creating an XML-based preferences "database." We're not talking about MySQL or Apache settings; we're talking about user-space applications. We're talking about word processing, e-mail, and browsing, those day-to-day workhorse applications that comprise the bulk of users' work.

Gconf is a great application, but it's not without its share of problems. Many developers look at Gconf as a pariah because newbie-level users can open the tool up and completely mess up their desktop settings, requiring you to come to the rescue. Many of the GNOME community feel the Gconf front-end just gives the user far too many confusing options to configure. So much controversy has come about with this tool that patches for many popular applications have arisen to add back to the applications once hidden options so to avoid the need for Gconf.

Ultimately, however, Gconf is a valuable tool. This article will introduce you to this tool and show you how to take advantage of its power.

What is Gconf?
Gconf is not your standard configuration tool. You won't find a bunch of point-and-click buttons like in individual application preferences. It would be best to think of Gconf as similar to the Windows Registry editor. Gconf is a front-end tool that writes to an XML preferences file. The files Gconf writes to are located in /.gconf. If you open up a terminal window and change to the /.gconf directory, you should see four subdirectories:

  • GNOME
  • apps
  • desktop
  • system
If you take a look in the apps directory, you will see subdirectories such as:
  • eog
  • gnome-session
  • nautilus
  • tomboy
  • NetworkManagerApplet
  • evolution
  • metacity
  • panel
There will also be a file within the apps directory called üonf.xml. This file will more than likely be empty. Each directory within .gconf contains this file. But, if you poke around deeper, you'll see the üonf.xml actually serves a purpose. Let's take a look at the ~/.gconf/apps/evolution/üonf.xml file. This file contains the following:

<?xml version="1.0"?><gconf> <entry name="last_version" mtime="1178123516" type="string"> <stringvalue>2.8.0</stringvalue> </entry> <entry name="version" mtime="1175861456" type="string"> <stringvalue>2.8.0</stringvalue> </entry></gconf>

The contents should be fairly obvious. This is the file that tells Gconf what version of Evolution is installed. Dig even further into this directory, and you'll see the following:
  • addressbook
  • calendar
  • mail
  • memos
  • shell
  • tasks
Let's look at the addressbook folder. Within that folder is yet another üonf.xml file. The contents of this file are a bit more complex:

<?xml version="1.0"?><gconf>      <entry name="sources" mtime="1175861455" type="list" ltype="string">           <li type="string">                <stringvalue><?xml version="1.0"?><groupuid="1175861455.20999.17@linux-wsbm" name="On This Computer" base_uri="file:///root/.evolution/addressbook/local" readonly="no"><sourceuid="1175861455.20999.18@linux-wsbm" name="Personal" relative_uri="system"><properties><property name="completion" value="true"/></properties></source></group></stringvalue>           </li>           <li type="string">                <stringvalue><?xml version="1.0"?><groupuid="1175861455.20999.19@linux-wsbm" name="On LDAP Servers" base_uri="ldap://" readonly="no"/></stringvalue>           </li>      </entry></gconf>


As the application gets larger, so does the XML file. Imagine having to hand-edit these files one at a time. Of course, that wouldn't happen, because you could simply fire up Evolution and make all of the configuration changes necessary. Although, then you'd have to fire up every application used to do so. Instead, Gconf comes to the rescue.

Starting up and poking around
Gconf is included in any of the GNOME 2.x releases. You can get the latest source from the GNOME FTP server. The GNOME team must have listened to the concerns of the developers, because the only way to fire up Gconf is from the command line. Working from OpenSuSE 10.2, there is no menu entry or clickable button from within one of the many YaST2 tools that will start Gconf. So you have to fire up a terminal and enter gconf-editor to start up Gconf. Figure A shows the opening screen for Gconf.

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

1 comments
dagar
dagar

I would like to see an article listing how the most popular distros handle certain gconf settings and how they affect the desktop experience. ie: Ubuntu does this ... OpenSUSE does this ... Fedora does this ... Then administrators can pick their favorite distro but might like how another distro handles certain features and can easily tweak their systems to get the most out of them.