Chapter 10. GNOME Configuration for Administrators

Contents

10.1. Using GConf for Defaults
10.2. Customizing Menus
10.3. Installing Themes
10.4. Configuring Fonts
10.5. MIME Types
10.6. Setting Screensavers
10.7. Session Management
10.8. Improving Performance
10.9. Hidden Directories
10.10. Security Note on Configuring SMB Printers
10.11. Disabling GNOME Desktop Features
10.12. Starting Applications Automatically
10.13. Automounting and Managing Media Devices
10.14. Changing Preferred Applications
10.15. Managing Profiles Using Sabayon
10.16. Adding Document Templates

This chapter discusses the following topics:

10.1. Using GConf for Defaults

GConf is a system for storing application preferences that simplifies the administration of user preferences. GConf lets system administrators do the following:

  • Set mandatory values for particular preferences for all users. This controls whether users can update particular preferences.

  • Set default values for particular preferences for all users.

  • Use suggested values for preferences that are specified in definition files for the preferences.

  • Read documentation on each preference.

GConf also notifies applications when a preference value changes, locally or across a network. Therefore, when you change a preference, all applications that use the preference are immediately updated.

GConf provides a preferences database, similar to a simple file system. The file system contains keys organized into a hierarchy. Each key is either a directory containing more keys or it has a value. For example, the key /apps/metacity/general/titlebar_font contains an integer value giving the size of the titlebar font for the Metacity window manager.

GConf has the following components:

10.1.1. GConf Repository

Each preference in the GConf repository is expressed as a key-value pair. A GConf preference key is an element in the repository that corresponds to an application preference. For example, the /apps/gnome-session/options/show_splash_screen preference key corresponds to the Show Splash Screen on Login option in the Sessions preference tool. The GNOME Desktop user interface does not contain all of the preference keys in the GConf repository. For example, the Panel preference tool does not contain an option that corresponds to the /apps/panel/global/tooltips_enabled key.

The repository is structured like a simple hierarchical file system. The repository contains the following:

  • Directories that correspond to applications that use the GConf repository. For example, the file system contains the directory /apps/metacity.

  • Subdirectories that correspond to categories of preferences. For example, the file system contains the directory /apps/metacity/general.

  • Special files that list the preference keys in the directory and contain information about the keys. For example, a file that contains information about the keys that relate to the HTTP proxy preferences is in the directory /system/http_proxy.

  • A /schemas directory that contains files that describe all of the preference keys.

Preference keys typically have simple values such as strings, integers, or lists of strings and integers. The format of the preference key in the repository depends on the backend module that is used to read the repository. The following is an example of the /desktop/gnome/interface/font_name preference key when an Extensible Markup Language (XML) backend module is used to read the repository:

<entry name=”font_name” mtime=”1038323555” muser=”user123” type=”string”>
<stringvalue>Sans 10</stringvalue>
</entry>
[Note]

When this guide refers to a preference key, the path to the key is added to the name of the key. For example, the font_name preference key in the /desktop/gnome/interface subdirectory is referred to as /desktop/gnome/interface/font_name.

10.1.1.1. GConf Configuration Sources

The GConf repository contains a series of storage locations that are called configuration sources. The configuration sources are listed in the /etc/opt/gnome/opt/gnome/gconf/ gconf-version-number/ path GConf path file. Each user has a path file. The path file specifies the following information for each configuration source:

  • Backend module to use to read the repository

  • Permissions on the repository

  • Location of the repository

The GConf path file also contains include instructions. By default, the contents of the GConf path file are as follows:

xml:readonly:/etc/opt/gnome/opt/gnome/gconf/gconf.xml.mandatory
include /etc/opt/gnome/opt/gnome/gconf/2/local-mandatory.path
include “$(HOME)/.gconf.path”
include /etc/opt/gnome/opt/gnome/gconf/2/local-defaults.path
xml:readwrite:$(HOME)/.gconf
xml:readonly:/etc/opt/gnome/opt/gnome/gconf/gconf.xml.defaults

When GConf searches for a preference value, it reads the configuration sources in the order specified in the path file. The following table describes the configuration sources in the path file:

Table 10.1. Configuration Sources in the Path File

Configuration Source

Description

Mandatory

The permissions on this configuration source are set to Read Only. Users cannot overwrite the values in this source, so the preferences in the source are mandatory.

User

This configuration source is stored in the .gconf directory in the home directory of the user. When the user sets a preference, the new preference information is added to this location.

You can use the Configuration Editor to modify the user configuration source.

Default

This configuration source contains the default preference settings.


The sequence of the configuration sources in the path file ensures that mandatory preference settings override user preference settings. The sequence also ensures that user preference settings override default preference settings. That is, GConf applies preferences in the following order of priority:

  1. Mandatory preferences

  2. User-specified preferences

  3. Default preferences

The include instructions in the GConf path file enable system administrators to specify other configuration sources:

Table 10.2. Other Configuration Sources

Included Configuration Source

Description

/etc/opt/gnome/opt/gnome/gconf/2/local-mandatory.path

Stores mandatory preference values for a particular system.

${HOME}/.gconf.path

Specifies the location of the configuration source in the .gconf.path file in the user's home directory.

/etc/opt/gnome/opt/gnome/gconf/2/local-defaults.path

Stores default preference values for a particular system.


10.1.1.2. GConf Schema

A GConf schema is a collective term for a GConf schema key and a GConf schema object. The following table describes schema keys and schema objects and their relationship to preference keys:

Table 10.3. Schema Keys and Objects

Item

Description

Preference key

An element in the GConf repository that corresponds to an application preference.

Schema key

A key that stores a schema object for a preference key.

Schema object

An element in a configuration source that contains information for a preference key, such as the following:

  • The name of the application that uses the preference key

  • The type of value required for the preference key (for example, integer, boolean, etc.)

  • A default value for the preference key

  • Brief documentation on the preference key


The following are examples of a preference key, a schema key, and a schema object:

Table 10.4. Preference Key, Schema Key, and Schema Object Examples

Preference key:

/desktop/gnome/interface/font_name

Schema key:

/schemas/desktop/gnome/interface/font_name

Schema object:

<schema> <applyto>/desktop/gnome/interface/font_name</applyto> <key>/schemas/desktop/gnome/interface/font_name</key> <owner>gnome</owner> <type>string</type> <default>Sans 10</default> <locale name=”C”> <short>Default font</short> <long>Name of the default font used by gtk+.</long> </locale>


You can associate a schema key with a preference key. For example, the following /desktop/gnome/interface/font_name key includes a schema key:

<entry name=”font_name” mtime=”1034873859” 
schema=”/schemas/desktop/gnome/interface/font_name”/>

When you associate a schema key with a preference key, the preference uses the suggested value that is specified in the schema object of the schema key. The suggested value is contained in the <default> element in the schema object. By default, all the preference keys in the default configuration source are associated with schema keys.

Typically, schemas are stored in the default configuration source.

10.1.1.3. GConf Schema Definition Files

Schemas are generated from schema definition files. A schema definition file defines the characteristics of all of the keys in a particular application. Schema definition files have a .schemas extension.

The schema definition files are included in the /etc/opt/gnome/opt/gnome/gconf/schemas directory. You can use the schema definition files to create a new configuration source.

Some schema definition files correspond closely to a part of the GNOME Desktop user interface. For example, system_http_proxy.schemas corresponds to the Network Proxy preference tool. Other schema definition files contain preference keys that are not present in the GNOME Desktop user interface. For example, the /apps/panel/global/tooltips_enabled key is not present.

Some parts of the GNOME Desktop user interface contain preferences that represent preference keys from more than one schema definition file. For example, the Keyboard Shortcuts preference tool contains preferences that represent keys from the panel-global-config.schemas and metacity.schemas files.

10.1.2. GConf Daemon

The GConf daemon is called gconfd-2. It notifies applications when a preference value changes. For example, you might choose to show only icons in toolbars in the Menus & Toolbars preference tool. When you select this option in the preference tool, the toolbars on all open applications are updated instantly. The daemon can operate locally or across a network.

An instance of the GConf daemon is started for each user. It does not have to deal with complex problems such as authentication and data security. When the daemon starts, it loads the GConf path file. The daemon also manages all access between applications and the configuration sources.

When an application requests the value of a preference key, the daemon searches the configuration sources as follows:

  1. Search for the value of the preference key in each configuration source, in the order specified in the path file.

  2. If the value is found, return the value.

  3. If the value is not found, search for the schema key that corresponds to the preference key in each configuration source, in the order specified in the path file.

  4. If the schema key is found, check the value of the schema key.

  5. If the value of the schema key is a schema object, return the suggested value in the <default> element of the schema object.

The GConf daemon also caches preference key values. All applications use this cache, so applications need to access the configuration sources only once.

To terminate the GConf daemon, use the following command:

gconftool-2 --shutdown 

10.1.3. GConf Command Line Tool

GConf includes a command line tool called gconftool-2. You can use gconftool-2 to perform the following tasks:

  • Set the values of keys

  • Display the values of keys

  • Install schemas from schema definition files when you install an application

For example, you would use the following command to display the values of all keys in the /desktop/gnome directory and subdirectories:

gconftool-2 --recursive-list /desktop/gnome 

The following table lists some of the options that you can use with the gconftool-2 command:

Table 10.5. gconftool-2 Options

Option

Function

--all-dirs

Lists all subdirectories in a directory that you specify.

--all-entries

Displays the values of all keys in a directory that you specify.

--config-source=configuration-source

Use with the --direct option to specify a configuration source to use. If you do not specify a configuration source with this option, the command runs on all configuration sources in the path file.

--direct

Use with the --config-source option to access a configuration source directly. When you use this option, GConf bypasses the server. Ensure that the GConf daemon, gconfd-2, is not running before you use this option.

--dump

Generates a list that contains all preference keys in a GConf repository directory that you specify. The list contains XML descriptions of all the keys, in a <gconfentryfile> element.

For example, you can redirect the output from this option to generate a file that lists all keys that are related to your panel configuration. You can use the --load option with this file.

--get

Displays the value of a preference key that you specify. Also displays the values of the elements in the schema object for a schema key that you specify.

--help

Displays a help message about the gconftool-2 command and the options that you can use with it.

--load=filename

Sets the values of preference keys in the current directory in a configuration source to the values in the file that you specify. The file that you specify must contain XML descriptions of the keys, in a <gconfentryfile> element.

--long-desc=description

Use with the --set-schema option to specify a long description for a schema key.

--makefile-install-rule

Installs schema definition files to applications.

--owner=owner

Use with the --set-schema option to specify an owner for a schema key.

--recursive-list

Displays the values of all preference keys in all subdirectories in a directory that you specify.

--recursive-unset

Resets the values of all preference keys, in all subdirectories in a directory, from the user setting to the setting in the default configuration source.

--set

Sets the value of a preference key and writes the value to the user configuration source. Use it with the --type option to specify the data type of the value that you want to set. For example, the following command sets the value of the /apps/gnome-terminal/profiles/Default/background_color key in the user configuration source:

gconftool-2 --set “/apps/gnome-terminal/profiles/Default/background_color” --type string “#000000” 

You can also use it with the --direct option and the --config-source option to write a value to another configuration source.

--set-schema

Sets the value of an attribute in a schema key and writes the value to the default configuration source.

Use it with the following options to specify the attribute that you want to update:

  • --type

  • --short-desc

  • --long-desc

  • --owner

For example, the following command sets the short description in the schema key for the /apps/gnome-terminal/profiles/Default/background_color key:

gconftool-2 --set-schema “/schemas/apps/gnome-terminal/profiles/Default/background_color” --short-desc “Default background color of terminal” 

--short-desc=description

Use with the --set-schema option to specify a short description for a schema key.

--shutdown

Terminates the GConf daemon.

--type=data-type

Specifies the data type when you set a value of a preference key. You can also use this option when you set the value of an attribute in a schema key. The following are valid data types:

  • bool

  • float

  • int

  • list

  • pair

  • string

--unset

Resets the value of a preference key from the user setting to the setting in the default configuration source.

--usage

Displays a brief help message about the gconftool-2 command and the options that you can use with it.


10.1.4. Setting Preference Values

You can set a mandatory value or a default value for a preference key. Before you change mandatory preference values or default preference values for users, you must ensure that the GConf daemon is not running for any user.

[Important]

Before you change mandatory preference values or default preference values for users, you must ensure that all users are logged out.

To set a mandatory value or a default value for a preference key, use the gconftool-2 command, as follows:

gconftool-2 --direct --config-source configuration-source --type data-type --set preference-keyvalue 

For example, to set wwwproxy.xyz.com as the mandatory HTTP proxy host, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/opt/gnome/gconf/gconf.xml.mandatory --type string --set /system/http_proxy/host wwwproxy.xyz.com 

The user cannot override this preference value.

You can also use the gconftool-2 command to set default values. For example, to set the default number of workspaces to five, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/opt/gnome/gconf/gconf.xml.defaults --type int --set /apps/metacity/general/num_workspaces 5 

The user can override this preference value.

10.1.5. Setting General Preferences

The following sections describe how to assign mandatory or default values to general preferences:

10.1.5.1. Setting HTTP Proxy Preferences

To set HTTP proxy preferences, modify the values of the preference keys in the /system/http_proxy/ location. For example, to set a mandatory value for the HTTP proxy host, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/opt/gnome/gconf/gconf.xml.mandatory --type string --set /system/http_proxy/host proxy-name

To set a default value for the HTTP proxy host, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/opt/gnome/gconf/gconf.xml.defaults --type string --set /system/http_proxy/host proxy-name

You can also set other HTTP proxy-related preferences. For more information, see the system_http_proxy.schemas schema definition file.

10.1.5.2. Setting Print Manager Preferences

To set print manager preferences, modify the values of the preference keys in the /apps/gnome-print-manager location. For example, if you do not want users to view the print jobs of other users, set a mandatory value as follows:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.mandatory --type bool --set /apps/gnome-print-manager/show_all_jobs false

To set a default value for this preference, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.defaults --type bool --set /apps/gnome-print-manager/show_all_jobs false

You can also set other print manager preferences. For more information, see the gnome-print-manager.schemas schema definition file.

10.1.5.3. Setting the Number of Workspaces

To set a mandatory number of workspaces, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.mandatory --type int --set /apps/metacity/general/num_workspaces integer

To set a default number of workspaces, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.defaults --type int --set /apps/metacity/general/num_workspaces integer

You can also set other window manager preferences. For more information, see the metacity.schemas schema definition file.

10.1.5.4. Setting Keyboard Accessibility Preferences

To set keyboard accessibility preferences, modify the values of the preference keys in the /desktop/gnome/accessibility/keyboard location. For example, if you want to set a mandatory value so that keyboard accessibility features are enabled, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.mandatory --type bool --set /desktop/gnome/ accessibility/keyboard/enable true

To set a default value for this preference, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.defaults --type bool --set /desktop/gnome/
accessibility/keyboard/enable false 

You can also set other keyboard accessibility preferences. For more information, see the desktop_gnome_accessibility_keyboard.schemas schema definition file.

10.1.5.5. Setting Keyboard Shortcut Preferences

To set keyboard shortcut preferences, modify the values of preference keys in /apps/ metacity/global_keybindings location. For example, you might want users to use only the Alt+F3 keyboard shortcut to open the Run Application dialog. To set this mandatory value, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.mandatory --type string --set /apps/metacity/global_keybindings ’<Alt>F3’

You can also set other keyboard shortcut preferences. For more information, see the metacity.schemas schema definition file.

10.1.5.6. Setting Panel and Panel Object Preferences

The panel-default-setup.entries file specifies the following details of the panels in the GNOME Desktop:

  • Number of panels

  • Types of the panels

  • Properties of the panels

  • Contents of the panels

The configuration of individual panels and of panel objects is a complex task. You must first understand the structure of the panel-default-setup.entries file. For more information, see Section 10.1.5.6.1, “Specifying Individual Panels and Panel Objects”.

To set preferences for individual panels and panel objects, you must set the values of many preferences in a configuration source. The easiest way to do this is to use the gconftool-2 command with the --dump and --load options. For more information, see Section 10.1.5.6.2, “Setting Preferences for Individual Panels and Panel Objects”.

10.1.5.6.1. Specifying Individual Panels and Panel Objects

The panel-default-setup.entries file contains sections that specify panels and panel contents, and it specifies values for schema keys. This file is located in the /etc/opt/gnome/gconf/schemas directory.

The panel-default-setup.entries file is structured as follows:

  1. Keys that specify the general structure of panels, applets, and other panel objects in the GNOME Desktop.

    The following keys specify the number of panels, panel objects, and applets that appear in the GNOME Desktop:

    • /apps/panel/default_setup/general/toplevel_id_list

    • /apps/panel/default_setup/general/object_id_list

    • /apps/panel/default_setup/general/applet_id_list

    The keys also assign identifiers to each panel, panel object, and applet. For example, the following sample from panel-default-setup.entries specifies that one panel appears in the GNOME Desktop:

    <entry>
          <key>toplevel_id_list</key>
          <schema_key>/schemas/apps/panel/general/toplevel_id_list
          </schema_key>
          <value>
            <list type=”string”>
              <value>
                <string>bottom_panel</string>
              </value>
            </list>
          </value>
        </entry>
    

    In the panel-default-setup.entries file, the identifier bottom_panel identifies the bottom edge panel.

  2. Keys that specify the properties of the panels.

    The panel property keys are structured as follows:

    /apps/panel/default_setup/toplevels/panel-name/panel-property-key
    

    For example, the /apps/panel/default_setup/toplevels/bottom_panel/size key specifies the size of the bottom panel.

  3. Keys that specify the panel objects, the panel object properties, and the panels where the objects reside.

    For example, the following sample from panel-default-setup.entries specifies a Main Menu object at the left side of the bottom panel:

    <entrylist base=”/apps/panel/default_setup/objects/main_menu”>
       <entry>
          <key>object_type</key>
          <schema_key>/schemas/apps/panel/objects/object_type</schema_key>
          <value>
            <string>menu-object</string>
          </value>
        </entry>
        <entry>
          <key>toplevel_id</key>
          <schema_key>/schemas/apps/panel/objects/toplevel_id</schema_key>
          <value>
            <string>bottom_panel</string>
          </value>
        </entry>
        <entry>
          <key>position</key>
          <schema_key>/schemas/apps/panel/objects/position</schema_key>
          <value>
            <int>0</int>
          </value>
        </entry>
    .
    .
    .
      </entrylist>
    
  4. Keys that specify the applets, the applet preferences, and the panels where the applets reside.

    For example, the following sample from panel-default-setup.entries specifies the Window List applet, in the bottom panel:

    <entrylist base=”/apps/panel/default_setup/applets/window_list”>
        <entry>
          <key>object_type</key>
          <schema_key>/schemas/apps/panel/objects/object_type
          </schema_key>
          <value>
            <string>bonobo-applet</string>
          </value>
        </entry>
        <entry>
          <key>toplevel_id</key>
          <schema_key>/schemas/apps/panel/objects/toplevel_id
          </schema_key>
          <value>
            <string>bottom_panel</string>
          </value>
        </entry>
        <entry>
          <key>position</key>
          <schema_key>/schemas/apps/panel/objects/position
          </schema_key>
          <value>
            <int>2</int>
          </value>
        </entry>
    .
    .
    .
        <entry>
          <key>bonobo_iid</key>
          <schema_key>/schemas/apps/panel/objects/bonobo_iid_type</schema_key>
          <value>
            <string>OAFIID:GNOME_WindowListApplet</string>
          </value>
        </entry>
      </entrylist>
    

    The OAFIID is a unique identifier for an applet. To find the OAFIID for a particular applet, see the .server file for the applet in the /usr/lib/bonobo/servers directory. For example, the following excerpt from GNOME_Wncklet_Factory.server shows the OAFIID for the Window List applet:

    <oaf_server iid=”OAFIID:GNOME_WindowListApplet” 
    type=”factory” location=”OAFIID:GNOME_Wncklet_Factory”>
    
10.1.5.6.2. Setting Preferences for Individual Panels and Panel Objects
  1. Log in to a GNOME session, then configure the panels as required.

  2. Use the --dump option with the gconftool-2 command line tool to generate a file that contains an XML description of your panel configuration.

    The --dump option generates a list that contains all preference keys in a GConf repository directory that you specify.

    For example, the following command creates an XML description of the default panel configuration in a file called my-panel-setup.entries:

    gconftool-2 --dump /apps/panel/profiles/default > my-panel-setup.entries 
    
  3. Open the my-panel-setup.entries file in a text editor, then modify the file as required.

    For example, you might want to change the location of the desktop entry files. The following is an excerpt from a file generated with the --dump option:

    <entry>
          <key>objects/object_16/launcher_location</key>
          <schema_key>/schemas/apps/panel/objects/launcher_location
          </schema_key>
          <value>
            <string>hadjaha-00adce02f7.desktop</string>
          </value>
        </entry>
    

    In the above example, you might want to change the reference to hadjaha-00adce02f7.desktop to another desktop entry file that is available globally.

    When you generate a panel configuration with the --dump option, the positions of the panel objects are absolute positions. You might want to change these positions to relative positions. The object at the extreme left of a panel has a position value of 0. The next object has a position value of 1, and so on. If you want object positions to be relative to the right side of the panel, set the value of the right_stick key to True.

  4. Use the --load option with the gconftool-2 command line tool to set the values of the default configuration source to the values in the my-panel-setup.entries file.

    For example, the following command sets the values of the keys in the default configuration source to the values of the corresponding keys in my-panel-setup.entries:

    gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.defaults --load my-panel-setup.entries
    

10.1.6. Setting Look-and-Feel Preferences

The following sections describe how to assign mandatory or default values to look-and-feel preferences:

10.1.6.1. Setting Font Preferences

To set font preferences, modify the values of two preference keys. The following table shows the keys to modify and the part of the user interface that the keys correspond to:

Table 10.6. Font Preference Keys

GConf Location

User Interface Component

/desktop/gnome/interface/font_name

Font preference tool, Application font option

/apps/nautilus/preferences/desktop_font

Font preference tool, Desktop font option


For example, to set Sans 12 as the mandatory application font, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.mandatory --type string --set /desktop/gnome/interface/font_name “Sans 12"

To set Palatino 12 as the default desktop object font, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.defaults --type string --set /apps/nautilus/preferences/desktop_font “palatino 12"

10.1.6.2. Setting Background Preferences

To set preferences for the desktop background, modify the values of the preference keys in the /desktop/gnome/background location. For example, to set a mandatory image for the background, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.mandatory --type string --set /desktop/gnome/background/picture_filename filename.png

To set a default value for this preference, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.defaults --type string --set /desktop/gnome/background/picture_filename filename.png

You can also set other background preferences. For more information, see the desktop_gnome_background.schemas schema definition file.

10.1.6.3. Setting Splash Image Preferences

To set splash image preferences, modify the value of the preference keys in the /apps/gnome-session/options/ location. For example, if you do not want users ever to see a splash image, set a mandatory value as follows:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.mandatory --type bool --set /apps/gnome-session/options/show_splash_screen false

To set a default value for this preference, use the following command:

gconftool-2 --direct --config-source xml:readwrite:/etc/opt/gnome/gconf/gconf.xml.defaults --type bool --set /apps/gnome-session/options/show_splash_screen false

You can also set other splash image preferences. For more information, see the gnome-session.schemas schema definition file.

10.1.7. Restoring Default Preference Values

To restore the default preference values for a user, use the following command:

gconftool-2 --direct --config-source user-configuration-source --recursive-unset

Replace user-configuration-source with the configuration source in the .gconf directory in the home directory of the user.

This command resets the values of all preference keys, in all subdirectories, from the user setting to the setting in the default configuration source.

10.1.8. Configuration Editor

The Configuration Editor (GConf Editor) lets you view and edit the values of the keys stored in the GConf repository.

To open the Configuration Editor:

  1. Press Alt+F2 to open the Run Application dialog box.

  2. Type gconf-editor, then click Run.

Figure 10.1. Configuration Editor Window

Configuration Editor Window

The Configuration Editor window contains the following panes:

Tree

Lets you navigate the directories and subdirectories in the GConf repository. Use this pane to display the keys that you want to modify in the modification pane. The tree pane is on the left side of the window.

Modification

Displays the keys in the selected GConf repository directory. Use this pane to select keys that you want to modify, and to modify the values of keys. The modification pane is in the upper part of the right side of the window.

The icons beside the keys in the modification pane indicate what type of value you can enter for the key. For example, the check mark icon beside the /system/http_proxy/use_http_proxy key indicates that you can enter a boolean value for the key.

The icons also indicate if you cannot edit the value of a key. For example, a key icon beside a schema key indicates that you cannot modify the value of the key.

Documentation

Displays documentation for the currently selected key. Use this pane to get more information about the GConf preference keys.

You can copy the names of keys so that you can paste them into another application. You can also add bookmarks to keys.

10.1.8.1. Modifying the Value of a Key

  1. Use the tree pane to display the key that you want to modify in the modification pane.

  2. Click the key you want to modify.

  3. To change the value of an integer key or a string key, click the Value column of the key and then type the new value for the key.

  4. To change the value of a boolean key, click the Value column of the key.

10.1.8.2. Copying a Key Name

  1. Click the key whose name you want to copy in the modification pane.

  2. Click Edit > Copy Key Name.

  3. If required, you can paste the name of the key into another application.

10.1.8.3. Using Bookmarks with Keys

To access a key in your bookmarks, select the key from the Bookmarks menu.

10.1.8.3.1. Adding a Bookmark
  1. Click the key that you want to bookmark in the modification pane.

  2. Click Bookmarks > Add Bookmark.

10.1.8.3.2. Deleting a Bookmark
  1. Click Bookmarks > Edit Bookmarks.

    An Edit Bookmarks dialog is displayed.

  2. Select a bookmark from the list on the left, then click Delete.

  3. Click Close.

10.2. Customizing Menus

SUSE Linux Enterprise10 lets you edit menus in either of the following ways:

10.2.1. Customizing the GNOME Main Menu with Alacarte

The Alacarte application enables you to customize the GNOME Main menu. Users can edit their own menus, and administrators can customize the menu for all users with accounts on the computer. The system-wide menu can also be distributed to other computers.

[Note]

Changes you have made to the Main menu are not overwritten during a subsequent system update. Changes are applied after the latest menu view is generated.

This section contains the following information:

10.2.1.1. Installing Alacarte

Alacarte is not installed when you install SUSE Linux Enterprise Desktop. To install Alacarte:

  1. Click Computer Control Center System YaST.

    YaST Control Center opens.

  2. (Conditional) If prompted, enter the root password.

  3. Click Software Software Management.

  4. In the search box, type alacarte, then click Search.

  5. Select alacarte, then click Accept.

  6. When prompted, insert the specified installation medium.

    For example, if you are using CDs, insert SUSE Linux Enterprise Desktop CD 2.

  7. Click OK.

    Wait a few moments while the system checks dependencies, then installs Alacarte.

  8. When asked whether you want to install more packages, click No.

Alacarte is now installed and two icons are added to the GNOME Control Center.

10.2.1.2. Starting Alacarte

  1. Click Computer Control Center Look and Feel.

  2. Click Main Menu Editor.

    There are two Main Menu Editor icons. Mouse over them to determine which is used for system-wide changes and which is used for your own local menu. Use the system-wide version if you are modifying a menu for all users on your system or want to distribute the menu to other computers. Use the regular version to modify your own menu.

The Menu Layout window opens.

Figure 10.2. Alacarte Menu Layout Window

Alacarte Menu Layout Window

You can now edit the menu.

10.2.1.3. Editing the Menu

This section describes the following ways you can edit the Main menu:

[Important]

The first time you use Alacarte, changes to the menu do not take effect until you log out and log back in. After the first time, changes appear immediately when you make them.

[Note]

Some features of Alacarte, such as the ability to nest groups and insert separators, apply only if you use older versions of the GNOME menu.

10.2.1.3.1. Finding Menu Items

The Menu Layout window is arranged with the Main menu submenus in the Menus list on the left and the items in the selected menu in the Items list on the right. Groups in a submenu are nested below that submenu. To find an item, click the arrow next to a submenu in the Menus list, select the group containing that item, then locate the item in the Items list.

For example, to locate the Sound Recorder application:

  1. Start Alacarte as described in Section 10.2.1.2, “Starting Alacarte”.

  2. Click the arrow next to the Audio & Video submenu in the Menus list, then select the Recording group.

  3. Locate Sound Recorder in the Items list.

10.2.1.3.2. Rearranging Menu Items

You can use Alacarte to change the order in which items appear in the Main menu. For example, you might want to place your frequently used applications at the top of the menu or at the top of their groups to make them easier to find.

To move an item, click it and drag it to a new location in the menu. You can move the item to a new location in the same menu, or drop it on an item in the Menus list to move it to a new menu or group.

10.2.1.3.3. Creating New Separators

Separators serve as visual cues to make it easier to find items in menus.

[Note]

Separators are not used in the current version of the GNOME menu. Adding a separator will have no effect. However, if you install and use an older version of the GNOME menu, you can use separators.

To create a separator:

  1. Select the item above the space where you want the separator to appear.

    For help locating an item, see Section 10.2.1.3.1, “Finding Menu Items”.

  2. Click New Separator.

The new separator appears beneath the selected item in the Items list. You can drag the separator to a new location like you would any other menu item. To delete a separator, see Section 10.2.1.3.5, “Deleting Items from the Main Menu”.

10.2.1.3.4. Showing or Hiding Menu Items

To show or hide an item, locate the item in the Items list, then select or deselect the box next to that item. When you hide an item, it remains in Items list and can be shown at another time if you decide you want it to appear in the menu. To delete an item from the Items list, see Section 10.2.1.3.5, “Deleting Items from the Main Menu”.

10.2.1.3.5. Deleting Items from the Main Menu

There are two ways to remove an item from the Main menu:

  • To remove an item but retain it in the Items list so you can easily add it to the menu, hide the item as explained in Section 10.2.1.3.4, “Showing or Hiding Menu Items”.

  • To delete an item from the Items list so it can no longer be shown, right-click the item and click Delete.

[Note]

Separators can not be hidden. They can only be added or deleted.

If you want to show a deleted item, you must add it like you would a new application. See Section 10.2.1.3.8, “Adding New Items to the Main Menu” for information about adding an application.

10.2.1.3.6. Renaming Menu Items
  1. Locate the menu item whose name you want to change, as explained in Section 10.2.1.3.1, “Finding Menu Items”.

  2. Right-click the item, then click Properties.

  3. Replace the current name with the name you want to give the item, then click Close.

The old name is replaced by the new one in the menu.

10.2.1.3.7. Changing an Item’s Generic Name

A short descriptive name appears beneath the name of each item in the Main menu. This is known as the generic name. To change the generic name:

  1. Locate the menu item whose generic name you want to change, as explained in Section 10.2.1.3.1, “Finding Menu Items”.

  2. Right-click the item, then click Properties.

  3. Replace the current generic name with the generic name you want to give the item, then click Close.

The old generic name is replaced by the new one in the menu.

10.2.1.3.8. Adding New Items to the Main Menu

You can add a new item to the Main menu. This is especially helpful when you install an application, but it is also useful if you have other applications that do not currently appear on the menu. You can also add a directory, a link, or another type of item to the menu.

To add an application to the Main menu:

  1. In the Menus list, click the arrow next to the menu containing the group where you want to add the application, then select the group.

    The contents of that group appear in the Items list.

  2. Click New Item.

  3. Type a name and generic name for the item.

  4. Click Browse and browse to the item.

  5. Select the item.

  6. Click the Type list, then select the type of item.

    For example, if you are adding a directory, click the list and select Directory. If you are adding an application, leave the default item type, Application, as is.

  7. (Optional) To assign an icon to the new item, click No Icon, then select an icon for the item.

    If you do not select an icon, the item appears in the menu without an icon.

  8. Click Close.

After the item is added to the menu, you can move it to the place where you want it to appear in the menu, as described in Section 10.2.1.3.2, “Rearranging Menu Items”.

10.2.1.3.9. Changing the Maximum Number of Items Allowed in the New Applications Group

When you install an application, it is usually added in its group in the Main menu, as well as to the New Applications group.

[Note]

Some applications do not add themselves to the menu when installed. You can add these applications to the Main menu yourself, using the instructions provided in Section 10.2.1.3.8, “Adding New Items to the Main Menu”.

By default, the New Applications group holds up to nine items. After the ninth new application is added, subsequent new applications replace the oldest item in the group.

To change the maximum number of applications allowed in the New Applications group:

  1. Open Alacarte.

  2. Click the up-arrow or down-arrow next to Application Browser: Max items in New Applications Group to increase or decrease the number.

  3. Click Close.

10.2.1.4. Changing a System-Wide Menu

Alacarte enables you to edit the system-wide Main menu for all users on the system, and distribute it to other computers. These additional systems need not have an identical setup to use the new menu.

[Note]

Changing the system-wide menu requires administrative privileges for the computer whose menu you want to change.

To change a system-wide menu and distribute it:

  1. Open Alacarte, using the launcher for the system-wide menu editor.

    See Section 10.2.1.2, “Starting Alacarte” for more information.

  2. Enter the root password.

  3. Make the desired changes to the menu, as described in Section 10.2.1.3, “Editing the Menu”.

  4. Click Close.

The changes you made now appear for all users of the system.

10.2.1.5. Distributing a System-Wide Menu to Other Computers

The changes you make to the system-wide menu are saved in the /etc/opt/gnome/alacarte-system directory. To use this menu on other computers:

  1. Copy the /etc/opt/gnome/alacarte-system directory to the other computers.

  2. Copy the following lines from the /etc/profile.d/xdg-enviroment.sh file on the original system to the /etc/profile.d/xdg-enviroment.sh file on the target system:

    #START SECTION ADDED BY ALACARTE
    export XDG_DATA_DIRS=/etc/opt/gnome/alacarte_system:$XDG_DATA_DIRS
    export XDG_CONFIG_DIRS=/etc/opt/gnome/alacarte_system:$XDG_CONFIG_DIRS
    #END SECTION ADDED BY ALACARTE
    

10.2.2. Customizing GNOME Menus Using Desktop and Directory Entry Files

The way in which the GNOME Desktop implements menus enables you to do the following:

  • Customize the menu hierarchy easily. The menu hierarchy is not based on the file system hierarchy. You can edit a small number of files to customize the menu hierarchy. You do not need to modify your applications or move files.

  • Install applications easily. You do not need to provide information about the menu hierarchy to applications when you install the applications.

  • Configure menus so that users cannot modify them.

Menus in the GNOME Desktop use the following components:

10.2.2.1. Desktop Entry Files

A desktop entry file is a data file that provides information about an item in a menu. This file specifies the details for the item such as a name, a command to run, or an icon. It also contains keywords which determine the location of the item in the menu hierarchy. Desktop entry files have a .desktop file extension.

The following is a sample desktop entry file:

[Desktop Entry]
Encoding=UTF-8
Name=Calculator
Comment=Perform calculations
Exec=gcalctool
Icon=gcalctool.png
Terminal=false
Type=Application
Categories=GNOME;Application;Utility;
X-GNOME-DocPath=gcalctool/gcalctool.xml

The following table describes the most important keys in desktop entry files.

Table 10.7. Desktop Entry File Keys

Desktop Entry Key

Description

Encoding

Specifies the encoding of the desktop entry file.

Name

Specifies the name of the item. This name is displayed on the item in the menu.

Comment

Specifies a short description of the item. The comment is displayed as a tooltip when you point to the item in the menu.

Exec

Specifies a command to execute when you select the item from the menu.

Icon

Specifies the filename of an icon that represents the item. Does not specify the file extension or the path to the filename.

Terminal

Specifies whether the command in the Exec key runs in a terminal window. If the value is True, the command runs in a terminal window.

If the command does not create a window in which to run, the value of this key must be True.

Type

Specifies the type of item. This value is one of the following:

  • Application: Use this option for an item that starts an application.

  • Link: Use this option for an item that links to a file, folder, or FTP site.

Categories

Specifies the keywords that describe the item. The keywords are separated with semicolons (;). To view a list of the standard category keywords, see the desktop menu specification at freedesktop.org

The vfolder information files map the keywords to menus.

X-GNOME-DocPath

Specifies the help file to display when you select Help on application-name from the menu item pop-up menu.


For more information on the keys in desktop entry files, see the desktop entry specification at http://www.freedesktop.org.

[Note]

Panel launchers and desktop objects also use desktop entry files. These desktop entry files provide the same information as for items in a menu. For example, the desktop entry files provide the command to run when a user selects the launcher or object.

10.2.2.2. Directory Entry Files

A directory entry file is a data file that provides information about a menu. The directory entry file specifies the details for the menu, such as a name, a tooltip, and an icon. Directory entry files have a .directory file extension.

The following is a sample directory entry file:

[Desktop Entry]
Name=Accessories
Comment=Accessories menu
Icon=gnome-util.png
Type=Directory

The following table describes the most important keys in directory entry files.

Table 10.8. Directory Entry File Keys

Directory Entry Key

Description

Name

Specifies the name of the menu, which is displayed on the menu.

Comment

Specifies a short description of the menu. The comment is displayed as a tooltip when you point to the menu.

Icon

Specifies the filename of an icon that represents the menu. Does not specify the file extension or the path to the filename.

Type

Specifies the type of menu. The value of this key is always Directory.


10.2.2.3. Editing Menus

SUSE Linux Enterprise uses the freedesktop.org menu specification. This specification uses the following files and directories:

Table 10.9. Menu File Locations

File

Description

/ets/xdg/menus/applications.menu

This file contains the XML definition for the default application menu layout. If a user has their own applications.menu, it replaces the system wide menu.

/ets/xdg/menus/applications-merged

This directory contains the default merge directories included in the <DefaultMergeDirs> element. You can add new <Menu> files in this location.

/ets/xdg/menus/preferences.menu

This file contains the XML definition for the GNOME Control Center.


For more detailed information on adding and editing menu items, see the Desktop Menu Specification Web site.

10.3. Installing Themes

A theme is a group of coordinated settings that specifies the visual appearance of a part of the GNOME Desktop. Users can select themes to change the appearance of the GNOME Desktop.

A theme contains settings that affect different parts of the GNOME Desktop, as follows:

Controls

Determines the visual appearance of windows, panels, and applets. It also determines the visual appearance of the GNOME-compliant interface items that appear on windows, panels, and applets (such as menus, icons, and buttons). Some of the controls setting options that are available are designed for special accessibility needs. Users can select an option for the controls setting from the Controls tabbed section in the Theme preference tool.

Window frame

Determines the appearance of the frames around windows only. Users can select an option for the window frame setting from the Window Border tabbed section in the Theme preference tool.

Icon

Determines the appearance of the icons on panels and the desktop background. Users can select an option for the icon setting from the Icons tabbed section in the Theme preference tool.

10.3.1. Theme Index File

Each theme has an index file which defines the characteristics of the theme. The name of the index file is /opt/gnome/share/themes/theme-name/index.theme.

The following is a sample theme index file:

[Desktop Entry]
Type=X-GNOME-Metatheme
Name=High Contrast Large
Name[es]=Alto contraste grande
Comment=Large black-on-white text and icons
Comment[es]=Textos e iconos grandes en negro sobre blanco
Encoding=UTF-8
[X-GNOME-Metatheme]
GtkTheme=HighContrastLargePrint
IconTheme=HighContrast
MetacityTheme=Atlanta
ApplicationFont=sans 18

The following table describes the keys in theme index files:

Table 10.10. Theme Index File Keys

Index File Key

Description

Type

Specifies that this theme determines the appearance of several theme options, such as controls, window frames, and icons.

Name

The name of the theme, which is displayed in the Theme preference tool.

Comment

A brief description of the theme, which is displayed under the name of the theme in the Theme preference tool.

GtkTheme

Corresponds to the controls setting in the Theme preference tool. Specifies which controls setting option to apply to windows, panels, and applets.

IconTheme

Corresponds to the icons setting in the Theme preference tool. Specifies which icons setting option to apply to panels and the desktop background.

MetacityTheme

Corresponds to the window frame setting in the Theme preference tool. Specifies which window frame setting option to apply to windows.

ApplicationFont

Corresponds to the application font setting in the Font preference tool.


10.3.2. Installing a New Controls Option

You can add a new option for the controls setting in the Theme preference tool. Controls options reside in the /opt/gnome/share/themes directory. The typical structure of a controls option in the file system is as follows.

Option file

/opt/gnome/share/themes/ option-name/gtk-2.0/gtkrc

Image files

/opt/gnome/share/themes/ option-name/pixmaps/*.*

Typically, a new option for the controls setting is supplied as a .tar.gz file. To install the new controls option, unzip the .tar.gz file and then untar the .tar file into the /opt/gnome/share/themes directory.

Users can install their own options for the controls setting. If a user installs an option for the controls setting, the option is stored in the $HOME/.themes directory.

10.3.3. Installing a New Window Frame Option

You can add a new option for the window frame setting in the Theme preference tool. Window frame options reside in the /opt/gnome/share/themes/option-name/metacity-1 directory. The typical structure of a window frame option in the file system is as follows.

Option file

/opt/gnome/share/themes/ option-name/metacity-1/metacity-theme-1.xml

Image files

/opt/gnome/share/themes/ option-name/metacity-1/*.*

Typically, a new option for the window frame setting is supplied as a .tar.gz file. To install the new window frame option, unzip the .tar.gz file and then untar the .tar file into the /opt/gnome/share/themes directory.

Users can install their own options for the window frame setting. If a user installs an option for the window frame setting, the option is stored in the $HOME/.themes directory.

10.3.4. Installing a New Icons Option

You can add a new option for the icons setting in the Theme preference tool. Icons options reside in the /opt/gnome/share/icons/option-name directory. The typical structure of an icons option in the file system is as follows.

Option file

/opt/gnome/share/icons/ option-name

Image files

/opt/gnome/share/icons/ option-name/icons/*.*

Typically, a new option for the icons setting is supplied as a .tar.gz file. To install the new icons option, unzip the .tar.gz file and then untar the .tar file into the /opt/gnome/share/icons directory.

Users can install their own options for the icons setting. If a user installs an option for the icons setting, the option is stored in the $HOME/.icons/option-name directory.

10.3.5. Installing Icons for Themes

The GNOME Desktop provides several themes that are designed for users with special visual needs. For example, some of the themes are designed for users with low vision. Several versions of icons might be required so that the icon can be displayed properly in each theme.

You might need to install a new icon for an application. When you install a new icon, you must create several versions of the icon so that the icon displays correctly in the themes. You must create several versions of the following types of icon:

  • Icons that are used within applications in the GNOME Desktop

  • Icons that are used internally by GTK+ applications or GTK+ stock icons

You can create the icons in several formats (for example, Portable Network Graphic (PNG) format). The suggested size of icons for the desktop environment is 48 x 48 pixels; at this size, most themes can rescale the icons.

When you install a new icon, create the following 48 x 48 pixel versions of the icon:

  • Regular icon

  • Low-contrast icon

  • High-contrast icon

  • Inverse high-contrast icon

If possible, also create 16 x 16 pixel versions of the each of the icons above, for themes that do not require large print.

Install the icons to the image files location that is specified for the theme in Section 10.3.2, “Installing a New Controls Option” or Section 10.3.3, “Installing a New Window Frame Option”. For example, to add icons to the HighContrastLargePrint theme, add the icons to the /opt/gnome/share/themes/HighContrastLargePrint/pixmaps directory. Add references to the icons to the relevant theme files. For example, to add icons to the HighContrastLargePrint theme, add references to the icons to the /opt/gnome/share/themes/HighContrastLargePrint/ gtk-2.0/gtkrc file. Modify the gtkrc file for the theme to associate the icon with a GTK stock icon identifier.

For more information on how to create icons for application launchers and panels, see the Icon Themes.

10.3.6. Creating a Custom Controls Option

If the options for the controls setting are not suitable for the needs of your users, you can create a custom controls option.

  1. Create a directory structure for the option in the /opt/gnome/share/themes directory.

    Use the same directory structure that other options use. For example, to create an option that is called SmallPrint, create the following directories:

    • /opt/gnome/share/themes/SmallPrint

    • /opt/gnome/share/themes/SmallPrint/gtk-2.0

  2. Locate the gtkrc file that is closest to meeting the needs of your users, then copy the file to the gtk-2.0 directory of your new option.

  3. Open the gtkrc file in a text editor and modify the attributes of the interface elements as needed.

  4. (Conditional) If the new option includes images, install the images for the new option in the pixmaps directory of your new option.

    If the new option uses images from another option, you do not need to create copies of the images for the new option. Instead, make sure that the reference to the images in the pixmap_path entry in the gtkrc file is correct.

Users can now select the new option for the controls setting.

For more information on gtkrc files, see the GTK+ Reference Manual .

10.4. Configuring Fonts

The GNOME Desktop uses the fontconfig font configuration and customization library. The fontconfig library can use all kinds of fonts, including PostScript Type 1 fonts and TrueType* fonts. The fontconfig library provides a list of all the fonts available on a system. To compile this list, fontconfig searches the directories listed in the /etc/fonts/fonts.conf file. To view all the fonts available on a system, access the fonts:/// location in the file manager on the system.

For more information about the fontconfig library, see the Fontconfig Web site.

10.4.1. Font Substitution

The fontconfig library performs font substitution when entire fonts or individual characters are not present. If the system needs to display a font that is not available, fontconfig attempts to display another, similar font. For example, if a Web page requests to display the Verdana font, and that font is not installed on the system, fontconfig displays a similar font, such as Helvetica. The list of similar fonts is defined in the /etc/opt/gnome/fonts/fonts.conf file.

If the system needs to display a character that is not present in the selected font, fontconfig attempts to display the character in another, similar font. For example, you might select Bitstream Vera Sans as the font for the Text Editor application. The Bitstream Vera font family does not include Cyrillic characters. If you open a document which contains a Cyrillic character, Text Editor uses a similar font that includes Cyrillic characters to display the character.

The fontconfig library also defines aliases for fonts (for example, serif, sans-serif, and monospace). When you select one of the aliases for a font, the system uses the first font that is defined for that alias in the /etc/opt/gnome/fonts/fonts.conf.

10.4.2. Adding a Font for All Users

  1. Copy the font file to one of the directories in the /etc/opt/gnome/fonts/fonts.conf file.

    Typically, fonts are stored in the /opt/gnome/share/fonts/ directory.

  2. (Conditional) The fontconfig library updates the list of fonts automatically. If the list of fonts is not updated, run the following command:

    fc-cache directory-name
    

10.4.3. Adding a Font for an Individual User

  1. Copy the font file to the $HOME/.fonts directory of the user.

    If you drag the font file to the fonts:/// location in the file manager, the font file is copied to the $HOME/.fonts directory.

  2. (Conditional) The fontconfig library updates the list of fonts automatically. If the list of fonts is not updated, run the following command:

    fc-cache directory-name
    

10.5. MIME Types

A Multipurpose Internet Mail Extension (MIME) type identifies the format of a file. The MIME type enables applications to read the file. Applications such as Internet browsers and e-mail applications use the MIME type to handle files of different types. For example, an e-mail application can use the MIME type to detect what type of file is attached to an e-mail.

The Nautilus file manager uses MIME types to identify the type of a file. The file manager needs to know the MIME type of a file to perform the following tasks:

  • Open the file in an appropriate application

  • Display a string that describes the type of file

  • Display an appropriate icon to represent the file

  • Display a list of other applications that can open the file

It is sometimes necessary to work out the correct MIME type for a file. This is usually done by examining the file's name or contents and looking up the correct MIME type in a database. If you add a new application (that is, extend the database), you must make sure that other applications can recognize the files associated with the application. For example, you might want to add the following:

  • image/png files should be edited using the Gimp.

  • image/png files should be described in English as Portable Network Graphics files.

  • Files whose names end in .png should have the type image/png.

You can use a graphical editor (such as MIME-Editor to edit the database, or you can do it manually by creating a file called $XDG_DATA_HOME/mime/packages/Override.xml in the format described below. For information on the XDG_ variables, see the Base Directory Specification.

When your new application is installed, it should install a file with the application's name in $XDG_DATA_DIRS/mime/packages. For example, running the ./configure && make install command with the Gimp will create /usr/local/share/mime/packages/gimp.xml.

This file has the following format:

<?xml version=”1.0” encoding=”UTF-8”?>
<mime-info xmlns=”http://www.freedesktop.org/standards/shared-mime-info”>
   <mime-type type=”image/png”>
         <comment xml:lang=”en”>PNG image</comment>
         <comment xml:lang=”af”>png bleed</comment>
         ...
         <magic priority=”50”>
                <match type=”string” value=”\x89PNG” offset=”0”/>
         </magic>
         <glob pattern=”*.png”/>
   </mime-type>
</mime-info>

This provides a comment in two languages, a rule to recognize PNG files by their contents, and a rule to recognize PNG files by their names. You can provide information about several types in the single application.xml file. You do not need to provide any information which is also in the base package.

You can also add extra elements if they are namespaced to avoid conflicts. For example:

<desktop:can-edit-with>gimp.desktop</desktop:can-edit-with>

This indicates that the named desktop entry file describes an application that can edit image/png files.

Information added to the database should be static (for example, “The Gimp can edit PNG files.”), not configuration (for example, “The Gimp is the preferred editor for PNG files.”). For more information on storing configuration information, see the Shared Configuration System Spec.

After you have installed the application.xml file, run the update-mime-database command to rebuild the output files. This program checks that the syntax of your file is correct and merges the information in it with the information in the other XML files in the packages directory. It then puts the rules for recognizing files into one set of files and the information about each type into other files (for example, $XDG_DATA_DIR/mime/image/png.xml) where other programs can easily access it.

When the application is uninstalled, the application.xml file is removed. Run update-mime-database again to remove the information from the database.

10.6. Setting Screensavers

A screensaver is an application that replaces the image on a screen when the screen is not in use. The screensaver application for the GNOME Desktop is XScreenSaver. The following sections describe how to set preferences for the XScreenSaver application and how to modify the displays that are available for the screensaver.

10.6.1. Setting Screensaver Preferences

Default screensaver preferences are stored in the XScreenSaver file, located in /usr/X11R6/lib/X11/app-defaults/XScreenSaver.

To modify screensaver application preferences, users can use the Screensaver preference tool. When a user modifies the screensaver preferences, the preferences are stored in the home directory of the user, in the $HOME/.xscreensaver file. For information on screensaver preferences, see the GNOME Desktop User Guide .

Users can also run the /usr/X11R6/bin/xscreensaver-demo command to open the XScreenSaver dialog.

To set default screensaver preferences for all users, modify the XScreenSaver file. You can also use the XScreenSaver dialog to create a $HOME/.xscreensaver file, then copy the file to the location of the XScreenSaver file.

To restore the default settings for a user, delete the $HOME/.xscreensaver file from the home directory of the user. If no $HOME/.xscreensaver file is present, the default preferences in the XScreenSaver file are used.

[Tip]

The default display behavior of XScreenSaver is to display a blank screen. The blank screen might confuse users. You might want to change this default display behavior.

To activate changes to the screensaver preferences, use the following command to reload screensaver preferences:

xscreensaver-command -restart 

10.6.2. Modifying Screensaver Displays

The screensaver application allows users to select one or more screensaver displays. A screensaver display is an application that displays images on the screen of the user when the screen is not in use. The screensaver displays are listed in the XScreenSaver file and in the $HOME/.xscreensaver file.

To add a new screensaver display, copy the executable file for the display to the directory where the displays are located. Add the command for the screensaver display to the XScreenSaver file or the $HOME/.xscreensaver file. Include any arguments that are required to run the screensaver display on the whole screen, rather than in a window. For example, you might want to include the -root option to display the screensaver display on the whole screen.

To disable a screensaver display, add a Minus sign (-) to the start of the command for the screensaver display in the preferences file. The following excerpt from a $HOME/.xscreensaver file shows a disabled Qix (solid) screensaver display:

-  “Qix (solid)”  qix -root -solid -segments 100

10.7. Session Management

A session occurs between the time that a user logs in to the GNOME Desktop and the time that the user logs out. The session manager starts after the login manager authenticates the user. The session manager lets the user manage the session. For example, a user can save the state of a session and return to that session the next time that he logs in.

At a minimum, the following applications run in a session:

  • The session manager, gnome-session.

  • The GConf X settings daemon, gnome-settings-daemon.

  • The gnome-panel application, which runs the panels in the GNOME Desktop.

  • The Metacity window manager.

The following table lists the files that contain default session information:

Table 10.11. Default Session Information Files

File

Description

/opt/gnome/share/gnome/default.session

Default session file. Default session details are stored in this file.

$HOME/.gnome2/session

User session file. When a user modifies the session, the details are stored in this file.


To set default session details for all users, modify the default session file.

To restore the default session settings for a user, delete the session file from the home directory of the user. If no user session file is present, the default settings in /opt/gnome/share/gnome/default.session are used.

To save the current session as the default session, users can run the gnome-session-save command.

GNOME also supports autostart. For more information, see Section 10.12, “Starting Applications Automatically”.

10.8. Improving Performance

This section discusses several preference settings you can change to improve the performance of the GNOME Desktop. You can use the gconftool-2 command to set values for preferences for users. The example commands in this section show how to set values in the user configuration source.

You can also use the --direct and --config-source options to set mandatory values or default values for preferences. And you can use the gconftool-2 command in a script to set the values of many preferences. For more information on the gconftool-2 command and the options that are available with the command, see Section 10.1, “Using GConf for Defaults”.

10.8.1. Reducing CPU Usage

There are a number of preferences that you can set to reduce CPU usage by the GNOME Desktop.

10.8.1.1. Using Theme Options That Require Less CPU Resources

Some window frame theme options load image files to draw the window frame. Other options use simpler techniques to draw the window frame. The Crux window frame option loads image files, but can be slow on systems with limited CPU resources. To reduce CPU usage, use one of the following window frame options:

  • Atlanta

  • Esco

The following window frame options also use fewer CPU resources than Crux:

  • AgingGorilla

  • Bright

  • Metabox

[Tip]

Metabox does not work well with inverse controls options such as HighContrastInverse. Use Atlanta with inverse controls options.

To change the window frame theme option, use the following command:

gconftool-2 --type string --set /apps/metacity/general/theme option-name

For example, to use Atlanta, run the following command:

gconftool-2 --type string --set /apps/metacity/general/theme Atlanta

Users can also use the Theme preference tool to select the appropriate option.

You can use the Metacity Theme Viewer to measure the performance of a window frame option and to preview the option. To start Metacity Theme Viewer, use the following command:

metacity-theme-viewer option-name 

For example, to measure the performance of Atlanta and preview Atlanta, use the following command:

metacity-theme-viewer Atlanta

10.8.1.2. Turning Off Display of Icons in Menus

Some items in menus display an icon beside the item. To turn off this feature, use the following command:

gconftool-2 --type bool --set /desktop/gnome/interface/menus_have_icons false

Users can also use the Menus & Toolbars preference tool to deselect the Show Icons in Menus option.

10.8.1.3. Turning Off the Splash Screen

When users log in to the desktop environment, a splash screen is displayed by default. Icons are displayed on the splash screen while the user logs in. You can turn off the splash screen to reduce CPU usage during login.

To turn off the splash screen, use the following command:

gconftool-2 --type bool --set /apps/gnome-session/options/show_splash_screen false

10.8.1.4. Turning Off Panel Animation

When users show or hide panels, the panels can show or hide in an animated style. To turn off panel animation, use the following command:

gconftool-2 --type bool --set /apps/panel/global/enable_animations false

Users can also use the Panel preference tool to deselect the Drawer and Panel Animation option.

10.8.1.5. Improving File Manager Performance

The Nautilus file manager includes some features that you can modify to improve performance.

10.8.1.5.1. Modifying Performance Preferences

The file manager includes performance-related preferences. Each of these preference can take any of the following three values.

Table 10.12. Performance-related Preferences

Value

Description

always

Performs the action for both local files and files on other file systems.

local_only

Performs the action for local files only. Using this value reduces CPU usage.

never

Never performs the action. Using this value reduces CPU usage and network traffic.


The following table describes the performance preferences for the file manager. For the fastest performance, set the value of the preferences to Never.

Table 10.13. File Manager Performance Preferences

Preference

Description

show_icon_text

Specifies when to preview the content of text files in the icon that represents the file. To never preview the content of text files, use the following command:

gconftool-2 --type string --set /apps/nautilus/preferences/ show_icon_text never

Users can also perform the following steps:

  1. Click Edit > Preferences in a file manager window, then click Preview.

  2. Select an option for the Show Text in Icons preference.

show_directory_item_counts

Specifies when to show the number of items in folders. To never show the number of items in folders, use the following command:

gconftool-2 --type string --set /apps/nautilus/preferences/ show_directory_item_counts never

Users can also perform the following steps:

  1. Click Edit > Preferences in a file manager window, then click Preview.

  2. Select an option for the Count Number of Items preference.

show_image_thumbnails

Specifies when to show thumbnails of image files. To never show thumbnails, use the following command:

gconftool-2 --type string --set /apps/nautilus/preferences/ show_image_thumbnails never

Users can also perform the following steps:

  1. Click Edit > Preferences in a file manager window, then click Preview.

  2. Select an option for the Show Thumbnails preference.

preview_sound

Specifies when to preview the content of sound files. To never preview the content of sound files, use the following command:

gconftool-2 --type string --set /apps/nautilus/preferences/preview_sound never

Users can also perform the following steps:

  1. Click Edit > Preferences in a file manager window, then click Preview.

  2. Select an option for the Preview Sound Files preference.


10.8.1.5.2. Turning Off the Side Pane, Toolbar, and Location Bar

The file manager includes preferences that let you turn off the side pane and the toolbar. Turning these off improves file manager performance.

To turn off the side pane, use the following command:

gconftool-2 --type bool --set /apps/nautilus/preferences/start_with_sidebar false

To turn off the toolbar, use the following command:

gconftool-2 --type bool --set /apps/nautilus/preferences/start_with_toolbar false

You can also turn off the location bar. Users can use the Ctrl+L keyboard shortcut to display a location bar when required.

To turn off the location bar, use the following command:

gconftool-2 --type bool --set /apps/nautilus/preferences/start_with_location_bar false
10.8.1.5.3. Turning Off the Desktop

The file manager contains a preference that lets users use Nautilus to manage the desktop. You can disable the desktop to improve performance. However, if you disable the desktop, you cannot

  • Use the Desktop menu.

  • Use the file manager to change the pattern or color of the desktop background.

  • Use the desktop objects, such as Trash. (The desktop objects are not displayed on the desktop.)

To disable the desktop, use the following command:

gconftool-2 --type bool --set /apps/nautilus/preferences/show_desktop false

10.8.2. Reducing X Window System Network Traffic

There are some preferences that you can set to reduce X Window System network traffic on the GNOME Desktop.

10.8.2.1. Using Theme Options That Create Less Network Traffic

Remote display protocols do not transfer every pixel in a block of pixels if all pixels in the block are the same color. To reduce X Window System network traffic, use one of the following window frame options that uses solid colors:

  • Atlanta

  • Esco

For information on how to change theme options, see Section 10.8.1.1, “Using Theme Options That Require Less CPU Resources”.

10.8.2.2. Turning Off Display of Icons in Menus

Some items in menus display an icon beside the item. This feature can increase X Window System network traffic if the icon is located on another file system or if the panels are displayed on a remote host.

For information on how to turn off this feature, see Section 10.8.1.2, “Turning Off Display of Icons in Menus”.

10.8.3. Reducing Color Usage and Improving Display Quality

Many modern computer systems support 24-bit color (that is, 16,777,216 colors). However, many users still use systems that support only 8-bit color (256 colors). The GNOME Desktop uses the websafe color palette. This palette is a general-purpose palette of 216 colors which is designed to optimize the use of color on systems that support 8-bit color. However, some visual components of the GNOME Desktop are designed for systems that support 24-bit color.

The following display problems might occur on systems that support only 8-bit color:

  • Windows, icons, and background images might appear grainy. Many themes, background images, and icons use colors that are not in the websafe color palette. The colors that are not in the palette are replaced with the nearest equivalent or a dithered approximation, which causes the grainy appearance.

  • Applications that do not use the websafe color palette have fewer colors available; therefore, color errors might occur. Some colors might not appear in the user interface of the application, and some applications might crash if the application cannot allocate colors.

  • Color flashing might occur when users switch between applications that use the websafe color palette and applications that do not use this palette. The applications that do not use the websafe color palette might use a custom colormap. When the custom colormap is used, other visual components might lose colors and then become unviewable.

The following sections describe how to optimize the appearance of the GNOME Desktop for systems that support only 8-bit color.

10.8.3.1. Using Theme Options That Use the Websafe Color Palette

Some window frame theme options use colors that are in the websafe color palette. Bright and Esco use colors from the websafe color palette and do not have the grainy appearance of other window frame options on 8-bit color displays. Use Bright or Esco for the best color display on 8-bit visual modes.

For information on how to change theme options, see Section 10.8.1.1, “Using Theme Options That Require Less CPU Resources”.

10.8.3.2. Reducing Color Usage by Turning Off Display of Icons in Menus

Some items in menus display an icon beside the item. If the icon contains colors that are not in the websafe color palette, this feature can increase the number of colors used.

For information on how to turn off this feature, see Section 10.8.1.2, “Turning Off Display of Icons in Menus”.

10.8.3.3. Reducing Color Usage by Turning Off the Splash Screen

You can turn off the splash screen to make more colors available for the GNOME Desktop and for applications.

For information on how to turn off the splash screen, see Section 10.8.1.3, “Turning Off the Splash Screen”.

10.8.3.4. Reducing Color Usage by Using a Solid Color for the Background

Use a solid color for the desktop background. This reduces the number of colors used by the GNOME Desktop.

To set a solid color for the background, use the following commands:

gconftool-2 --type string --set /desktop/gnome/background/picture_options none
gconftool-2 --type string --set /desktop/gnome/background/color_shading_type solid
gconftool-2 --type string --set /desktop/gnome/background/primary_color \#hexadecimal-color

Users can also use the Background preference tool to choose a solid color for the background.

10.9. Hidden Directories

The following table describes the hidden directories that the GNOME Desktop adds to the home directories of users. A hidden directory is a directory that has a name that begins with a period (.).

Table 10.14. Hidden Directories Added to Users’ Home Directories

Directory

Description

.esd_auth

Contains the authentication cookie for the GNOME sound daemon, the Enlightened Sound Daemon (ESD).

.gconf

Contains the GConf configuration source for the user. When the user sets a preference, the new preference information is added to this location.

.gconfd

Contains the following GConf daemon details:

  • Configuration information

  • Lock information for objects that are referenced by an Interoperable Object Reference (IOR)

  • State information for objects that are referenced by an IOR

.gnome

Contains user-specific application data that is not stored in the GConf repository. For example, this directory contains MIME type information and session information for the user.

.gnome-desktop

The Nautilus file manager contains a preference that enables users to use the file manager to manage the desktop. If this option is selected, this directory contains the following:

  • Objects on the desktop (for example, the Home object, the Trash object, and other launchers). The objects appear in the directory as desktop entry files. For example, the starthere.desktop file contains a link to the Start Here location.

  • Removable media volumes that are mounted.

The file manager also contains a preference that enables users to use the home directory as the desktop directory, instead of .gnome-desktop. If a user selects this option, the contents of the home directory are displayed as desktop objects.

.gnome2

Contains user-specific application data that is not stored in the GConf repository, such as the following:

  • Keyboard shortcut information

  • Window location information

  • Desktop entry files for panel launchers

This directory also contains user-specific menu data. If a user modifies menus, the details are stored here.

.gnome2-private

(Ignore this directory. It currently has no function.)

.metacity

Contains session data for the Metacity window manager.

.nautilus

Contains file manager data that is specific to the use, such as the following:

  • Metadata for the directories with which the user works

  • Nautilus emblems that the user adds

  • Nautilus desktop images

.themes

Contains controls theme options, window frame theme options, and icons theme options that the user adds. The user can add themes from the Theme preference tool.

.thumbnails

Contains image thumbnails for the user. The image thumbnails are used in the file manager. The file manager contains a preference that the user can select to stop generation of thumbnail images.

.xscreensaver

Contains screensaver configuration data and screensaver preference data.


10.10. Security Note on Configuring SMB Printers

Windows network shares are also referred to as Samba or SMB shares. When you configure a printer on an SMB share, you must enter a username and password for the print queue.

The username and password are stored as unencrypted text in the /etc/opt/gnome/cups/printers.conf file. This file has read-only permissions for users with root privileges, so any user with root privileges can read the username and password for the print queue.

To reduce the impact of possible security violations, make sure that the username and password required to access the print queue is used only for the print queue. This ensures that any possible security violation is restricted to unauthorized use of the print queue.

10.11. Disabling GNOME Desktop Features

The GNOME Desktop includes features you can use to restrict access to certain of its functions. These disable (or lockdown) features let you restrict the actions that users can perform on a computer. For example, you might want to prevent command line operations on a computer that is for public use at a trade show.

You disable feature by setting GConf keys (see Section 10.1, “Using GConf for Defaults”). You can also use the Configuration Editor application to set GConf keys in a user configuration source (see Section 10.1.8, “Configuration Editor”).

10.11.1. Disabling Lock Screen and Log Out

To disable the lock screen and log out functions, set the /apps/panel/global/disable_lock_screen key and the /apps/panel/global/disable_log_out key to True.

When you disable the lock screen and log out functions, the following items are removed from the panels:

  • Lock Screen and Log Out user menu items from the Main Menu

  • Lock and Log Out menu items from the Add to Panel > Actions menu

    To open this menu, right-click a vacant space on a panel and then click Add to Panel > Actions.

  • Lock Screen and Log Out user menu items from the Actions menu in the Menu Bar applet

Additionally, any Lock Screen buttons and Log Out buttons on panels are disabled.

10.11.2. Disabling Command Line Operations

To disable operations from a command line, set the /desktop/gnome/lockdown/disable_command_line key to True.

When you disable command line operations, the following changes occur in the user interface:

  • The Run Application menu item is removed from the following menus:

    • Main Menu

    • Actions submenu in the Add to Panel menu

    • Actions menu in the Menu Bar applet

  • Any Run buttons on panels are disabled

To disable command line operations, you must also remove menu items that start terminal applications. For example, you might want to remove menu items that contain the following commands:

  • GNOME Terminal command ( /opt/gnome/bin/gnome-terminal)

  • /usr/bin/xterm

  • /usr/bin/setterm

These items are removed from the following menus:

  • Main Menu

  • Add to Panel > Launcher From menu

To disable command line operations, you must also disable the Command Line applet. To disable this applet, add the applet to the /apps/panel/global/disabled_applets key. When you disable the Command Line applet, it is removed from the Main Menu and the Add to Panel > Utility menu.

10.11.3. Disabling Panel Configuration

To disable panel configuration, set the /apps/panel/global/locked_down key to True.

When you disable panel configuration, the following changes occur in the user interface:

  • The following items are removed from the Panel and Drawer pop-up menus:

    • Add to Panel

    • Delete This Panel

    • Properties

    • New Panel

  • The launcher popup menu is disabled.

  • The following items are removed from the Applet pop-up menu:

    • Remove from Panel

    • Lock

    • Move

  • The Main Menu pop-up menu is disabled.

  • The Launcher drag feature is disabled so that users cannot drag launchers to or from panels.

  • The Panel drag feature is disabled so that users cannot drag panels to new locations.

10.12. Starting Applications Automatically

To automatically start applications in GNOME, use one of the following methods:

  • To run applications for every user: Put .desktop files in /opt/gnome/share/autostart or /opt/gnome/share/gnome/autostart.

  • To run applications for an individual user: Put .desktop files in ~/.config/autostart.

To disable an application that starts automatically, add X-Autostart-enabled=false to the .desktop file.

10.13. Automounting and Managing Media Devices

The GNOME Volume Manager (gnome-volume-manager) monitors volume-related events and responds with a user-specified policy. You can use the GNOME Volume Manager to automatically mount hot-plugged drives and inserted removable media, automatically run programs, automatically play audio CDs and video DVDs, and automatically import photos from a digital camera.

GNOME Volume Manager is started automatically. To disable GNOME Volume Manager, add X-Autostart-enabled=false to the /opt/gnome/share/gnome/autostart/gnome-volume-manager.desktop file.

You can use the GConf Editor to configure GNOME Volume Manager settings. Open the GConf Editor by pressing Alt+F2 to open the Run Application dialog box, type gconf-editor, then click Run. GNOME Volume Manager is located under /desktop/gnome/volume_manager.

10.14. Changing Preferred Applications

To change users’ preferred applications, edit /etc/opt/gnome/gnome_defaults.conf.

After editing the file, run SuSEconfig --module gnome-vfs2.

10.15. Managing Profiles Using Sabayon

Sabayon is a system administration tool you can use to create and apply desktop environment profiles. A profile is a collection of default settings and restrictions that can be applied to either individual users or groups of users. Sabayon lets you edit GConf defaults and mandatory keys using a graphical tool.

Profile definition is done through a graphical session similar to the one a user would be running, only inside a desktop window. You can change properties (such as the desktop background, toolbars, and available applets) in the usual way. Sabayon also detects changes to the default settings in most desktop applications.

Files or documents that are left in the simulated home directory or on the desktop are included in the finished profile. This includes many application-specific databases, such as Tomboy notes. Using this mechanism, it is easy to supply introductory notes or templates in a manner easily accessible to new users.

A user profile can inherit its settings from a parent profile, overriding or adding specific values. This enables hierarchical sets of settings. For example, you can define an Employee profile and derive Artist and Quality Assurance profiles from that.

In addition to providing defaults, Sabayon can also lock down settings. This makes the setting resistant to change by users. For instance, you can specify that the desktop background cannot be changed to something other than the default you provide. It prevents casual tampering with settings, potentially reducing the number of helpdesk calls, and enabling kiosk-like environments. However, it does not provide absolute security and should not be relied on for such.

Sabayon also provides a list of settings for applications and generic user interface elements that have built-in lockdown support, including LibreOffice and the GNOME panel. For example, the panel can be set up to allow only specific applets to be added to it and prevent changing its location or size on the screen. Likewise, the Save menu items can be disabled across all applications that use it, preventing users from saving documents.

The profiles are transferable to other computers. They reside in /etc/opt/gnome/desktop-profiles/, and each profile is saved in a separate ZIP file.

10.15.1. Creating a Profile

Profiles are saved in ZIP files located in /etc/opt/gnome/desktop-profiles. Each profile you save is stored in a separate ZIP file as name-of-the-profile.zip . You can copy or move profiles to other computers.

  1. Click Computer+More Applications+System+Desktop Profile Editor.

  2. If you are not logged in as root, type the root password, then click Continue.

  3. Click Add.

  4. Specify a name for the profile, then click Add.

  5. Select the profile, then click Edit.

    A new desktop session opens in an Xnest window.

  6. In the Xnest window, make the changes to the settings that you want.

    Each setting you change appears in the Xnest window.

    You can choose to make each setting mandatory (click Edit+Enforce Mandatory in the Xnest window), to ignore a setting (click Edit+Changes+Ignore), or make a setting the default (don’t select either Ignore or Mandatory).

  7. To lock settings for users, click Edit+Lockdown in the Xnest window.

    You can choose from the following options:

    Panel: Lets you lock down the panels, disable force quit, disable lock screen, disable logout, and disable any of the applets in the Disabled Applets list.

    LibreOffice: Lets you define the macro security level for LibreOffice documents, load and save options, and user interface options.

  8. To save the profile, click Profile+Save.

    The profile is saved in /etc/opt/gnome/desktop-profiles.

  9. Click Profile+Quit to close the Xnest window, then click Close to exit Sabayon.

10.15.2. Applying a Profile

You can apply a profile to individual users or to all users on a workstation.

  1. Click Computer+More Applications+System+Desktop Profile Editor.

  2. If you are not logged in as root, type the root password, then click Continue.

  3. Select the profile you want to apply, then click Users.

  4. Select the users you want to use this profile.

    To apply this profile to all users on this workstation, click Use this profile for all users.

  5. Click Close.

10.16. Adding Document Templates

To add document templates for users, fill in the Templates directory in a user's home directory. You can do this manually for each user by copying the files into ~/Templates, or system-wide by adding a Templates directory with documents to /etc/skel before the user is created.

A user creates a new document from a template by right-clicking the desktop and selecting Create Document.