1.6. Setting General Preferences

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

1.6.1. To Set HTTP Proxy Preferences

To set HTTP proxy preferences, you 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, run the following command:

# gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type string --set /system/http_proxy/host proxy_name

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

# gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /system/http_proxy/host proxy_name

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

1.6.2. To Set Print Manager Preferences

To set print manager preferences, you 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/gconf/gconf.xml.mandatory --type bool --set /apps/gnome-print-manager/show_all_jobs false

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

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

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

1.6.3. To Set the Number of Workspaces

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

# gconftool-2 --direct --config-source xml:readwrite:/etc/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/gconf/gconf.xml.defaults --type int --set /apps/metacity/general/num_workspaces integer

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

1.6.4. To Set Keyboard Accessibility Preferences

To set keyboard accessibility preferences, you 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, run the following command:

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

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

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

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

1.6.5. To Set Keyboard Shortcut Preferences

To set keyboard shortcut preferences, you modify the values of preference keys in two locations. The following table shows the locations to modify, and the part of the user interface to which the locations correspond:

GConf Location

User Interface Component

/apps/panel/global

Keyboard Shortcuts preference tool, Desktop section

/apps/metacity/general

Keyboard Shortcuts preference tool, Window Management section

For example, you might want users to use only the Alt+F3 keyboard shortcut to open the Run Program dialog. To set this mandatory value, run the following command:

# gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type string --set /apps/panel/global/run_key '<Alt>F3'

You might want users to use Alt+F11 to maximize windows, by default. To set this default value, run the following command:

# gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /apps/metacity/window_keybindings/maximize '<Alt>F11'

You can also set other keyboard shortcut preferences. For information on the other keyboard shortcut preferences, see the panel-global-config.schemas and metacity.schemas schema definition files.

1.6.6. To Set Global Panel Preferences

To set global preferences for panels, you modify the values of the preference keys in the /apps/panel/global location. For example, if you do not want users to ever use panel animation, set a mandatory value as follows:

# gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type bool --set /apps/panel/global/enable_animations false

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

# gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type bool --set /apps/panel/global/enable_animations false

You can also set other global panel preferences. For information on the other global panel preferences, see the panel-global-config.schemas schema definition file.

1.6.7. To Set Preferences for Individual Panels and Panel Objects

The panel-per-panel-config.schemas schema definition file specifies the following details of the panels on the 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. To configure individual panels and panel objects, you must first understand the structure of the panel-per-panel-config.schemas schema definition file. For more information on the panel-per-panel-config.schemas schema definition file, see the next section.

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 set the values of many preferences is to use a script. For a sample script that sets preferences for a panel and objects on the panel, see Sample Script for Setting Individual Panel Preferences.

1.6.7.1. Schema Definition File for Individual Panels and Panel Objects

The schema definition file panel-per-panel-config.schemas contains sections that specify panels and panel contents for small, medium, and large screens. The section for small screens and the section for large screens are not functional at the time of publication of this guide. To learn about preference keys for panels or panel objects, read the section for medium screens only.

The medium section of the file panel-per-panel-config.schemas is structured as follows:

  1. Preference keys that specify the general structure of panels, applets, and other panel objects on the desktop. The following keys specify the number of panels, applets, and other panel objects that appear on the desktop:

    • /apps/panel/default_profiles/medium/general/panel_id_list

    • /apps/panel/default_profiles/medium/general/applet_id_list

    • /apps/panel/default_profiles/medium/general/object_id_list

    The keys also assign identifiers to each panel, applet, and panel object. For example, the following excerpt from panel-per-panel-config.schemas specifies that two panels appear on the desktop:

    <key>/schemas/apps/panel/default_profiles/medium/
    general/panel_id_list</key>
    .
    .
    .
    <default>[00000001,00000002]</default>

    In panel-per-panel-config.schemas, the identifier 00000001 identifies the bottom edge panel, and the identifier 00000002 identifies the Menu Panel.

  2. Preference keys that specify the properties of the panels. The panel property keys are structured as follows:

    /apps/panel/default_profiles/medium/panels/panel_number/panel_property_key

    For example, the key /apps/panel/default_profiles/medium/panels/00000001/screen_edge specifies the edge of the display on which the bottom edge panel resides.

    The keys that specify the properties of the bottom edge panel are listed first. The keys that specify the properties of the Menu Panel are listed at the end of the medium section in panel-per-panel-config.schemas.

  3. Preference keys that list the panel objects, the panel object properties, and the panels in which the objects reside. For example, the following excerpt from panel-per-panel-config.schemas specifies object 00000001:

    <key>/schemas/apps/panel/default_profiles/medium/
    objects/00000001/object_type</key>
    .
    .
    .
    <default>launcher-object</default>
    .
    .
    .
    <key>/schemas/apps/panel/default_profiles/medium/
    objects/00000001/launcher_location</key>
    .
    .
    .
    <default>applications:///nautilus.desktop</default>
    .
    .
    .
    <key>/schemas/apps/panel/default_profiles/medium/
    objects/00000001/panel_id</key>
    .
    .
    .
    <default>00000002</default>

    The object is a launcher that starts Nautilus file manager. The launcher resides in the Menu Panel.

  4. Preference keys that list the applets, the applet preferences, and the panels in which the applets reside. For example, the following excerpt from panel-per-panel-config.schemas specifies applet 00000001:

    <key>/schemas/apps/panel/default_profiles/medium/
    applets/00000001/object_type</key>
    .
    .
    .
    <default>bonobo-applet</default>
    .
    .
    .
    <key>/schemas/apps/panel/default_profiles/medium/
    applets/00000001/panel_id</key>
    .
    .
    .
    <default>00000001</default>
    .
    .
    .
    <key>/schemas/apps/panel/default_profiles/medium/
    applets/00000001/bonobo_iid</key>
    .
    .
    .
    <default>OAFIID:GNOME_TasklistApplet</default>

    The applet is the Window List applet. The applet resides in the bottom edge panel.

1.6.7.2. Sample Script for Setting Individual Panel Preferences

This section contains a sample script that sets the preferences for a panel that has the following major characteristics:

  • The panel is an edge panel, and resides at the bottom edge of the screen.

  • The panel contains a file manager launcher and a Terminal launcher.

  • The panel contains a Window List applet.

The sample script also sets other minor preferences. All of the preferences have default values, not mandatory values.

The sample script follows:

#Usageis:set_key<type><key><value><extraoptionsifany>

functionset_key()
{
TYPE="$1"
shift
KEY="$1"
shift
VALUE="$1"
shift
OTHER_ARGS="$*"
gconftool-2--direct--config-sourcexml:readwrite:/etc/gconf/gconf.xml.defaults
--owner=panel$OTHER_ARGS--type"$TYPE"--set"$KEY""$VALUE"
}

#Definethenumberofpanels,thenumberoflaunchers,andthenumberofapplets
set_keylist/apps/panel/default_profiles/medium/general
/panel_id_list[00000001]--list-typestring
set_keylist/apps/panel/default_profiles/medium/general
/object_id_list[00000001,00000002]--list-typestring
set_keylist/apps/panel/default_profiles/medium/general
/applet_id_list[00000001]--list-typestring

#Definethecharacteristicsofthepanel
set_keystring/apps/panel/default_profiles/medium/panels
/00000001/panel_typeedge-panel
set_keystring/apps/panel/default_profiles/medium/panels
/00000001/panel_sizepanel-size-x-small
set_keystring/apps/panel/default_profiles/medium/panels
/00000001/screen_edgepanel-edge-bottom
set_keybool/apps/panel/default_profiles/medium/panels
/00000001/hide_buttons_enabledfalse
set_keystring/apps/panel/default_profiles/medium/panels
/00000001/panel_background_typeno-background

#Definethefirstlauncher
set_keystring/apps/panel/default_profiles/medium/objects
/00000001/object_typelauncher-object
set_keystring/apps/panel/default_profiles/medium/objects
/00000001/launcher_location'applications:///nautilus.desktop'
set_keystring/apps/panel/default_profiles/medium/objects
/00000001/panel_id00000001
set_keyint/apps/panel/default_profiles/medium/objects
/00000001/position20

#Definethesecondlauncher
set_keystring/apps/panel/default_profiles/medium/objects
/00000002/object_typelauncher-object
set_keystring/apps/panel/default_profiles/medium/objects
/00000002/launcher_location'applications:///System/gnome-terminal.desktop'
set_keystring/apps/panel/default_profiles/medium/objects
/00000002/panel_id00000001
set_keyint/apps/panel/default_profiles/medium/objects
/00000002/position25

#Definetheapplet
set_keystring/apps/panel/default_profiles/medium/applets
/00000001/object_typebonobo-applet
set_keystring/apps/panel/default_profiles/medium/applets
/00000001/bonobo_iidOAFIID:GNOME_TasklistApplet
set_keystring/apps/panel/default_profiles/medium/applets
/00000001/panel_id00000001
set_keyint/apps/panel/default_profiles/medium/applets
/00000001/position25