The following sections describe how to assign mandatory or default values to general 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.
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.
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.
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.
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.
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.
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.
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:
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.
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.
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.
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.
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:
# Usage is: set_key <type> <key> <value> <extra options if any>
function set_key()
{
TYPE="$1"
shift
KEY="$1"
shift
VALUE="$1"
shift
OTHER_ARGS="$*"
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults
--owner=panel $OTHER_ARGS --type "$TYPE" --set "$KEY" "$VALUE"
}
# Define the number of panels, the number of launchers, and the number of applets
set_key list /apps/panel/default_profiles/medium/general
/panel_id_list [00000001] --list-type string
set_key list /apps/panel/default_profiles/medium/general
/object_id_list [00000001,00000002] --list-type string
set_key list /apps/panel/default_profiles/medium/general
/applet_id_list [00000001] --list-type string
# Define the characteristics of the panel
set_key string /apps/panel/default_profiles/medium/panels
/00000001/panel_type edge-panel
set_key string /apps/panel/default_profiles/medium/panels
/00000001/panel_size panel-size-x-small
set_key string /apps/panel/default_profiles/medium/panels
/00000001/screen_edge panel-edge-bottom
set_key bool /apps/panel/default_profiles/medium/panels
/00000001/hide_buttons_enabled false
set_key string /apps/panel/default_profiles/medium/panels
/00000001/panel_background_type no-background
# Define the first launcher
set_key string /apps/panel/default_profiles/medium/objects
/00000001/object_type launcher-object
set_key string /apps/panel/default_profiles/medium/objects
/00000001/launcher_location 'applications:///nautilus.desktop'
set_key string /apps/panel/default_profiles/medium/objects
/00000001/panel_id 00000001
set_key int /apps/panel/default_profiles/medium/objects
/00000001/position 20
# Define the second launcher
set_key string /apps/panel/default_profiles/medium/objects
/00000002/object_type launcher-object
set_key string /apps/panel/default_profiles/medium/objects
/00000002/launcher_location 'applications:///System/gnome-terminal.desktop'
set_key string /apps/panel/default_profiles/medium/objects
/00000002/panel_id 00000001
set_key int /apps/panel/default_profiles/medium/objects
/00000002/position 25
# Define the applet
set_key string /apps/panel/default_profiles/medium/applets
/00000001/object_type bonobo-applet
set_key string /apps/panel/default_profiles/medium/applets
/00000001/bonobo_iid OAFIID:GNOME_TasklistApplet
set_key string /apps/panel/default_profiles/medium/applets
/00000001/panel_id 00000001
set_key int /apps/panel/default_profiles/medium/applets
/00000001/position 25