Gentoo Wiki ArchivesGentoo Wiki

Customizing_GNOME


Installation

Tips

Administration

Others

edit

Contents

Introduction

Seek further support from: irc.gnome.org#docs

http://gnomesupport.org/wiki

This page is the second part of a 'best practices' guide written with the idea that you are an administrator wishing to customize Gnome for a large number of end-users (such as your mom, students, co-workers -- supposedly "normal" people) to be as simple and easy to use as possible so that they get the best impression of GNU/Linux right from the get-go. It will cover configuring the current version (2.8 or 2.10) of Gnome using gconf-tool for GTK/Gnome applications which support it, as well as a few other ways for applications which don't. There are some example configurations given for some common changes that might need to occur to suit users in an educational or business environment while trying very hard to keep the burden of administration as light as possible.

You might start by first installing Gentoo, or at least looking it over, proceeding to install Gnome with many commonly used applications and perhaps take a look at setting up thin-clients to access this desktop when you're done.

When this guide becomes outdated, please update it!!! That's what a wiki is for

Using Administrative Tools in Gnome

As an administrator, it's important to be able to ensure a consistent look and feel across desktop systems. This section describes how to manage Gnome preferences on one machine, how you make it consistent across all systems is up to you. I'd suggest imaging (using G4U or G4L), exporting /etc from a server, or an ssh script as root.

Keywords: All Users, User Defaults, Gnome Defaults, Documents and Settings, Default User

We'll discuss these three types of settings

For

Overview

Most Gnome applications hook into gconfd which is a daemon that monitors a registry-like database of user settings. When a change occurs in a configuration which gconfd is monitoring, the change immediately takes effect throughout all gnome applications (changing the theme, for example). The administrator can choose to change the OoBE (out of box experience) that users get when first logging into a workstation by adding mandatory settings (such as a proxy) or default settings (such as a desktop image). Keeping that example in mind, it's conceivable that the user could circumvent mandatory settings (such as a proxy) by using a program which doesn't support gconfd or recompling a program which does. You will also find that many programs' defaults which are not gconfd enabled will require you to edit their configuration file in /etc, create default settings in /etc/skel (and script something to overwrite current user settings), or change the source code of the program.

Important directorys where these settings are kept are (in order which they are processed)

/etc/gconf/gconf.xml.mandatory/
~/.gconf/
/etc/gconf/gconf.xml.defaults/

A user can modify his settings the usual way (clicking around in preferences menus), through gconf-editor (GUI), or gconftool-2 (command line) for his own settings in ~/.

As an administrator, gconf-editor allows for editing of mandatory and default settings. See the option in the File menu. gconftool-2 is a much more powerful tool, but neither gconf-editor or gconftool-2 allow you to search through the settings as effectively well as using grep. I'll also let you in on a little secret: since gconfd uses a virtual directory structure which is physically represented in three different places, it does get a little confusing at times. You have to scratch your head, sit back, and just think logically for a few minutes sometimes.

How might a pimpin' penguin grep up those files? Try something like this:

grep background -iR ~/.gconf/ /etc/gconf/gconf.xml.* | less

Gnome 2.10 Note

In Gnome <= 2.8 gconf settings were immediately written to disk. In 2.10 gconf settings are written on logout or when gconftool-2 --shutdown is run.

GUI Tools

General Desktop Settings

Say that you want, as a user to have a particular desktop image and you wanted to use gconf-editor to do so, you might first open gconf-editor and under 'Edit -> Find' search for 'background'. The results that return represent the virtual/logical directory structure of the gconfd settings. Thus changing one of these settings would affect ~/.gconf/desktop/gnome/background/%gconf.xml.

Applications -> System Tools -> Configuration Editor
Edit -> Find # Case sensitive
[x] Search also in key names

If as the administrator you were looking at the Defaults Window in gconf-editor you would be able to change the default backgroud in the same virtual path, but it would represent /etc/gconf/gconf.xml.defaults/desktop/gnome/background/%gconf.xml.

# You should never log into x as root!!!
DISPLAY=":0.0" sudo gconf-editor
File -> New Defaults Window

If as the administrator you were looking at the Mandatory Window in gconf-editor you would be realizing one of the major downfalls of gconf-editor - it only allows you to edit settings which already exist, not create or delete keys. Right now on your fresh install.... there aren't ANY mandotory settings.

File -> New Mandatory Window

So now you have the option of (option here means "not-really-an-option") using gconftool-2.

Code: using gconftool-2 to create mandatory setting
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
  --type string \
  --set /desktop/gnome/background/picture_filename \
  /usr/share/pixmaps/wallpaper/desktop.png

It may look like a headache at first glance, but there are really only 4 variables in this command. Let me break this down as clearly as possible:

Code: using gconftool-2 to create mandatory setting
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.[defaults|mandatory] \
  --type [int|bool|float|string|list|pair] \
  --set [/virtual/path/to/key] \
  [value(s)]

In the above example, notice that we specify the key 'picture_filename', but physically all keys belonging to the same virtual path exist in a similar physical path together in %gconf.xml, along with their values.

Now, the Gnome guys would probably like to shoot me for saying this, but if you're a big fan of doing things the wrong way if I said this, because you'll most likely screw things up if you do it, but for the case above where no settings existed previously, you could do a little bash action as well. For example, if you were a cruel cruel guy, you might decide that the defaults were good enough for everyone - and you don't care if Sue is left-handed, she's using right-handed mouse settings from now on (dang it!!!), you might do this:

Code: the wrong way
 mkdir /etc/gconf/gconf.xml.mandatory/desktop/gnome/background/
 cp /etc/gconf/gconf.xml.defaults/desktop /etc/gconf/gconf.xml.mandatory/

People would hate you, but it should work.

NOTE: Technically, you shouldn't modify any settings directly if the gconf daemon is running (it is always running when someone is logged into GNOME)! Since it caches settings, they may be overwritten or could even corrupt the xml files!

That's it, it's that simple. You can go home now. But for the heck of it I'll include some other common desktop setting changes:

Code: examples of common settings
 # Show Tooltips
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
  --type bool \
  --set /apps/panel/global/tooltips_enabled \
  true

 # Don't open folders in new windows
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
  --type bool --set \
  /apps/nautilus/preferences/always_use_browser \
  true

 # Single-click opens files and folders
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
  --type bool \
  --set /desktop/gnome/peripherals/mouse/single_click \
  true

 # Roll-up titlebar instead of maximize
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
  --type string \
  --set /apps/metacity/general/action_double_click_titlebar \
  toggle_shade

 # don't show startup errors
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
  --type bool \
  --set /apps/gnome_settings_daemon/screensaver/show_startup_errors \
  false

 # Don't use a screensaver
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
  --type bool \
  --set /apps/gnome_settings_daemon/screensaver/start_screensaver \
  false

Here's what needs to change to set the theme to Lush (you could mix and match):

Code: Change gtk theme to Lush
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
  --type string \
  --set /desktop/gnome/interface/gtk_key_theme \
  Lush
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
  --type string \
  --set /desktop/gnome/interface/gtk_theme \
  Lush
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
  --type string \
  --set /desktop/gnome/interface/icon_theme \
  Lush
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
  --type string \
  --set /desktop/gnome/interface/theme \
  Lush

Customizing Panels

If you've been looking in the official Gnome Administrator Guide (2.6) you may have noticed that the instructions for customzing panels are incorrect for gnome 2.10. If you want to know the easy way to do it in 2.8 read the official guide as I'm going to take this opportunity to write documentation where none currently exists.

I'm going to explain this in a step-by-step fashion, but you could set up all of the applets on a panel just the way you want it and then do it all at once as well.

Check what applets currently exist and, as an example, add MiniCommander

[alt-click on the panel] Add to panel
[select the MiniCommander applet] Add

Flush the settings to disk

gconftool-2 --shutdown
ls ~/.gconf/apps/panel/applets/

You should see a new applet directory (containing information about the applet, and its position on the panel), probably applet_7. Rename it to what it really is. If you have several applet_x's then you can find out the normal name fairly easily.

grep OAFIID .gconf/apps/panel/applets/applet_7/%gconf.xml
 <stringvalue>OAFIID:GNOME_MiniCommanderApplet</stringvalue>
mv ~/.gconf/apps/panel/applets/applet_7 ~/.gconf/apps/panel/applets/MiniCommander

Next change the general panel configuration file to reflect the new name of the applet's directory

vim ~/.gconf/apps/panel/general/%gconf.xml


Code: Dump your personal panel settings
 # Gnome 2.8
 gconftool-2 \
  --dump /apps/panel/profiles/default > my-panel-setup.entries

 # Gnome 2.10
 gconftool-2 \
  --dump /apps/panel > my-panel-setup.entries

Now you will need to edit the panel settings you created. There are a few things you should pay attention to:

Some things will be a little strange with this method -
  e.g. if you search for launch_location in the dump file it references a .desktop file which has been copied into the home dir.
My advice would be to just manually edit /etc/gconf/schemas/panel-default-setup.entries and load that.
It isn't too hard to add another applet.
File: Examples
none yet
Code: Load your personal panel settings as defaults
 gconftool-2 --direct \
  --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
  --load my-panel-setup.entries

Some instructions on scripting customisations to Gnome Panel can be found here http://www.byteclub.net/wiki/GnomePanel

Customizing Application Menus

custom icons creating new .desktop files

Associating mime-types with Nautilus

example using .exe files and wine

Printer Configuration

making cups printer accessible to all

See also


Last modified: Sun, 07 Sep 2008 08:08:00 +1000 Hits: 38,543

Created by NickStallman.net, Luxury Homes Australia
Real estate agents should list their apartments, townhouses and units in Australia.