SUSE Support

Here When You Need Us

Set Global Mandatory gconf Settings For All Users

This document (7007945) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise 11 and later.
openSUSE 11.x
Users logging into the GNOME desktop.

Situation

All users are logging into the GNOME desktop.  Certain settings need to be common for all users and need to be locked down so they cannot be modified by the users.  Company policies may require a common background, common keyboard shortcuts, screensaver that locks after a specified number of minutes, etc.

Resolution

The GNOME Desktop stores system configuration settings in GConf.  Some applications also take advantage of GConf to store their settings and configuration.  For Windows users, the GConf data could be compared to the registry.

GConf data is stored in XML files.  The common files for all users are located in /etc/gconf.  By default all users can modify their individual settings that are stored in the GConf data.  The changes made by users are exceptions to the default settings and are kept in the user's home directory under .gconf.  If you browse the ~/.gconf directory you will see a directory structure that matches the GConf structure which can be viewed and edited using the gconf-editor program.  Users modify their personal settings by simply changing such settings as the mouse speed and acceleration, keyboard shortcuts, keyboard settings, appearance settings, desktop background, appearance settings, etc.  The GNOME Control Center (selectable from the Main "Computer" Menu) is where many of these settings can be changed in a nice graphical application.  The "gconf-editor" program can be run from a command line to bring up a graphical tool which allows the user to browse the settings by expanding or drilling down into the different areas.  There is no menu selection for this tool because it is not common for end users to make direct changes to the GConf data.

Mandatory settings are placed in the /etc/gconf/gconf.xml.mandatory directory.  There is no graphical tool like gconf-editor to create these settings, but there is a command-line equivalent that can be used to create the entry.  As an example let's create a mandatory setting that sets the desktop background to a specific picture that we want everyone to use.  The path in the GConf data to the specific setting is "/desktop/gnome/background"  The key we want to change is "picture_filename".  The type of value this key holds is a "string". And finally, the string we will assign this key is "/usr/share/backgrounds/cosmos/blue-marble-west.jpg" which is a background that is included by default with SLED 11 SP1.  Here's the resulting command that needs to be run as the root user:

gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type string --set /desktop/gnome/background/picture_filename "/usr/share/backgrounds/cosmos/blue-marble-west.jpg"

NOTE:  This command is all one line and is not broken up as it may appear here.

The users that are currently logged in will not see the change until their next login.

This same command can be used to set any of the GConf settings.  Just replace the path to the specific key, make sure the "--type" is set correctly and use the appropriate value for the key.  Not all data types require the quotes.  For example boolean (can be abbreviated in the command as "bool") will require true or false, no quotes needed.  Integer requires the whole number, no quotes.  Float requires the number and can included decimal places, again with no quotes.

To view the available settings and to search for specific settings along with their value type and current setting use the gconf-editor.  The "Find" option can be located under the "Edit" drop-down menu.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7007945
  • Creation Date: 17-Feb-2011
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Desktop
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.