Panel Configuration

Configuration Layout

The Panel's configuration is one of the more complex set of GConf keys. This section gives an overview of how those keys are organised.

Most of the Panel's configuration is stored in /apps/panel/profiles/default. The general directory contains the following keys:

toplevel_id_list

The list of panel identifiers. Each identifier is also the name of the sub-directory in toplevels directory which contains the actual preferences for that panel.

object_id_list

The list of panel object identifiers. Each identifier is also the name of the sub-directory in objects directory which contains the actual preferences for that panel object.

applet_id_list

The list of panel applet identifiers. Each identifier is also the name of the sub-directory in applets directory which contains the actual preferences for that panel applet.

Thus, the default contents of /apps/panel/profiles/default looks something like:


 /apps/panel/profiles/default/general:
   toplevel_id_list = [bottom_panel]
   object_id_list = [main_menu,web_launcher,...]
   applet_id_list = [workspace_switcher,...]

 /apps/panel/profiles/default/toplevels/bottom_panel:
   size = 48
   expand = true
   name = Bottom Panel
   orientation = bottom
   ...

 /apps/panel/profiles/default/objects/main_menu:
   toplevel_id = bottom_panel
   object_type = menu-bar
   position = 0
   locked = true
   ...

 /apps/panel/profiles/default/objects/web_launcher:
   toplevel_id = bottom_panel
   object_type = launcher-object
   position = 1
   launcher_location = applications:///Internet/redhat-web.desktop
   ...

 /apps/panel/profiles/default/applets/clock:
   toplevel_id = bottom_panel
   object_type = bonobo-applet
   position = 0
   panel_right_stick = true
   locked = true
   bonobo_iid = OAFIID:GNOME_WindowListApplet
   ...
           

Default Configuration

The default panel configuration is specified in /etc/gconf/schemas/panel-default-setup.entries. When the panel is installed, the default configuration is loaded into Defaults Source using gconftool-2's --load argument:

# gconftool-2 --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults --direct --load /etc/gconf/schemas/panel-default-setup.entries

This command loads the default configuration into the /apps/panel/default_setup GConf directory. However, the default configuration also needs be loaded into the /apps/panel/profiles/default directory. This is also done at installation time using the following command:

# gconftool-2 --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults --direct --load /etc/gconf/schemas/panel-default-setup.entries /apps/panel/profiles/default/default_setup

The reason the default configuration must to be loaded in two different locations is that on multi-screen systems, the panel makes a copy of the default configuration from /apps/panel/default_setup, modifies the copy for each newly detected screen and loads the copy into /apps/panel/profiles/default.

Modifying the Default Configuration

Modifying the Panel's default configuration is one of the more difficult tasks to get right. Unfortunately, it is also one of the more common tasks for administrators wishing to deploy a modified desktop environment configuration.

The following sections take the reader through a set of progressively more complex examples of how one might modify the default Panel configuration.

Example 1

To begin with lets consider a relatively straightforward example and assume that we wish to remove the Print Manager launcher and the Notification Area from the default configuration.

  • Make a copy of /etc/gconf/schemas/panel-default-setup.entries:

    # cp /etc/gconf/schemas/panel-default-setup.entries /etc/gconf/schemas/foo-panel-default-setup.entries

  • Edit foo-panel-default-setup.entries and remove the print_launcher entry from object_id_list and remove the print_launcher directory from the objects directory:

               <value>
                 <string>spreadsheet_launcher</string>
               </value>
    -          <value>
    -            <string>print_launcher</string>
    -          </value>
             </list>
             </list>
           </value>
         </entry>
    ...
    -  <!-- Print Launcher -->
    -
    -    <entry>
    -      <key>objects/print_launcher/object_type</key>
    -      <schema_key>/schemas/apps/panel/objects/object_type</schema_key>
    -      <value>
    -        <string>launcher-object</string>
    -      </value>
    -    </entry>
    ...
    -    <entry><key>objects/print_launcher/menu_path</key><schema_key>/schemas/apps/panel/objects/menu_path</schema_key></entry>
    -    <entry><key>objects/print_launcher/action_type</key><schema_key>/schemas/apps/panel/objects/action_type</schema_key></entry>
    -
       <!-- Workspace Switcher Applet -->
                      

  • Next, remove the systray entry from applet_id_list and remove the systray directory from the applets directory:

                 <string>mixer</string>
               </value>
               <value>
    -            <string>systray</string>
    -          </value>
    -          <value>
                 <string>clock</string>
               </value>
               <value>
    ...
    -  <!-- System Tray Applet -->
    -
    -    <entry>
    -      <key>applets/systray/object_type</key>
    -      <schema_key>/schemas/apps/panel/objects/object_type</schema_key>
    -      <value>
    -        <string>bonobo-applet</string>
    -      </value>
    -    </entry>
    ...
    -    <entry><key>applets/systray/menu_path</key><schema_key>/schemas/apps/panel/objects/menu_path</schema_key></entry>
    -    <entry><key>applets/systray/launcher_location</key><schema_key>/schemas/apps/panel/objects/launcher_location</schema_key></entry>
    -    <entry><key>applets/systray/action_type</key><schema_key>/schemas/apps/panel/objects/action_type</schema_key></entry>
    -
       <!-- Clock Applet -->
                      

  • Create the configuration source into which you will load your modified default setup:

    # mkdir --mode a=rwx,g=rx,o=rx /etc/gconf/foo.xml.defaults

    It is important your configuration source is created using the correct --mode argument to ensure it is readable by all users. GConf will use the permissions from this toplevel directory when creating new files or directories in the configuration source.

  • Load the default setup into /apps/panel/default_setup and /apps/panel/profiles/default in the new configuration source:

    # gconftool2 --config-source=/etc/gconf/foo.xml.defaults --direct --load /etc/gconf/schemas/foo-panel-default-setup.entries

    # gconftool2 --config-source=/etc/gconf/foo.xml.defaults --direct --load /etc/gconf/schemas/foo-panel-default-setup.entries /apps/panel/profiles/default

  • Add the new configuration source to /etc/gconf/2/local-defaults.path which will cause the source to appear before the Defaults Source for all users.

    # echo "xml:readonly:/etc/gconf/foo.xml.defaults" > /etc/gconf/2/local-defaults.path

    Note

    This change will only come into effect when the GConf daemon is re-started. Therefore, it is preferable to make the change with all users logged out.

Example 2

Same changes as in the section called “Example 1” and lockdown the panel so it can't be modified.

Example 3

A more complicated example involving a new non-expanded panel at the top of the screen in the middle with a few launchers or something.

Example 4

Change and lockdown some applets' settings.