1.5. To Set 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. Ensure that all users are logged out before you change preference values for users.

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_key value

For example, to set wwwproxy.xyz.com as the mandatory 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 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, run the following command:

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

The user can override this preference value.

Caution

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