Created Wednesday 29/12/2004
The Gnome desktop is a shell that integrates the Nautilus file manager and other components like a window manager and other features like virtual desktop, panel and similar.
Configuration is split between user entires in $HOME/.gconf, which can be edited with gconf-editor or by hand (the %gconf.xml files contained within the .gconf sub-directories are xml and the contents are pretty self explanatory).
Other components of gnome, such as the items that appear in the start menu and similar are controlled via *.desktop files in /usr/share/applications and in ~/Desktop
Warning: The icon structures packaged in directories which encapsualte the size (e.g., 64x64/apps and so on) and or which are packaged under scalable (E.g., scalable/apps) is for older versions of Gnome (prior to 2.10). The newer version of Gnome simply package the png/svg (etc) into apps, devices, places and so on.
Todo: Update the section on Gnome icon directory structures to reflect the new(er) style of directory packaging (i.e., now not contained in scalable or sized directories like 64x64/and so on).
Gnome 1 and 2 coexist, especially if an older version of Linux is upgraded to a newer one. E.g., from Redhat 9 to Fedora Core. The configuration directories for Gnome are:
Note, a lot of the xml configuration files, held in ~/.gnome2, simply hold pointers off to other locations. E.g., the change background utility doesn't import the selected file, it simply updates backgrounds.xml by adding a entry that has a value that is a string pointer to the selected file.
Gconf is a registry and is used by the gconf daemon, called gconfd, to perform application configuration. The files are simple xml text files called %gconf.xml and are packaged into subdirectories named for the application that they configure. These files are contained with the ~/.gconf directory and the gconftool-2 and gconf-editor are tools provided for accessing and manipulating the gconf registry.
The gconf registry can be updated by either directly editing the %gconf.xml files or by using the gconf-editor(1) tool. Either approach achieves the same outcome and it arguable that the tool actually provides much benefit given that it just presents a hierarchical tree view of the gconf registry.
Accessing the gconf registry is performed with the gconftool (gconftool-1 for Gnome 1.x and gconftool-2 for Gnome version 2.x). This registry is used to access things like the default browser or editor. For example, the Gnome Desktop browser button runs htmlview and many of the values, such as the actual browser to execute, are determined by providing keys to gconftool-2, like so:
bash $ gconftool-2 -g /desktop/gnome/url-handlers/http/command
Which will return a path to the preferred browser to execute. The same applies to locating an editor, terminal, mail client and similar.
User changes to installed applications are contained with the ~/.gconf registry structure. Examples include the gnome-terminal open url (shift click) and the user splash (shown on login and gnome startup). Some user-level gconf settings:
The user splash screen shown on user login is controlled via $HOME/.gconf/apps/gnome-session/options/%gconf.xml
The open url feature of gnome-terminal is controlled by the %gconf.xml registry file in $HOME/.gconf/desktop/gnome/url-handlers/<protocol>/%gconf.xml Where <protocol> is http, ftp or similar. The content of these handlers is important and should point the lib directory containing the browser libs.
Gnome uses gtk and metacity themes. These are accessed by name within both /usr/share/themes and ~/.themes. Note, that Gtk1 themes are not usable in a Gtk2 environment (as used by Gnome 2.x). The basic theme structure is packaed in a directory (i.e., the name of the theme) and contains a file called index.theme. There are two sibling subdirectories gtk-2.0/ for Gtk2 and Gnome 2.x and metacity-1 for Gtk1 and Gnome 1.x. In addition, the theme may contain fonts and curors. In general, a theme named MyTheme contains:
The gtk-2.0 component of the theme directory is the most interesting as it's used by Gtk2 and Gnome 2.x. The gtk-2.0 directory contains a configuration file called gtkrc, which defines things like window decorations, menu bar background, mouse-over and mouse-away effects and much more. The gtkrc file also defines the icon theme and this is done, by convention, by importing an iconrc, which is typically in a subdirectory called icons. E.g.,
MyTheme/gtk-2.0/gtkrc MyTheme/gtk-2.0/icons/iconrc
A gtkrc file can contain any number of "include" directives and may choose to separate icons into window control icons, such as those found on dialogs and within nautilus (like the back/forward/up buttons) and the general applications icon themes like those that appear on the desktop for the Trash, Computer and for 3rd party applications that might appear with the Start Menu.
Gtk themes can inherit from other themes and is specified in the index.theme file. This allows themes to be built incrementally from other themes. The inherits directive can specify a preference order for themes to fallback to if the current theme is missing a component. For example, a theme called 'MyTheme'' might specify an inheritance clause such as:
inherits=Other,Bluecurve
If MyTheme defines a volume-max resource, within it's iconrc but not a volumne-min, then the resource resolution for volume-max will be that contained within the icon set of Theme However, the resource resolution process for volume-min will turn to the Other theme and try to find an entry within it's icon specification. If the Other theme does not specify the resource, then the next item in the inherits clause is examined and so on. Note, that if Other also specifies an inherits clause then this is tried before the next item of the MyTheme inherit clause (which is Bluecurve in the above example).
Icon packs specify Desktop and 3rd party application icons as well as icons for within dialogs and applications like Nautilus. This is much the same as that specified within the icon spec for a gtk theme (within gtkrc). Icon packs are specified by name and are configured by an index.theme within the named directory. Icons, as specified by a gtk theme, follow a search path of:
$HOME/.icons /usr/share/icons
Many old icon packs contain a directories with the same images scaled to different sizes. Typically, these are packaged into groups like apps and devices and are replicated into standard sizes, such as:
However, the Gnome environment now has Scalable Vector Graphics support (SVG) and so many newer themes contain a single directory called scalable which is then divided into the typical groups, e.g.,:
In this way, both non-scalable vector graphics and SVG's can coexist. In general, it's preferable to use an SVG's icon them as SVG's are capable of scaling to (almost) arbitrarily large or small sizes whilst maintaining crystal clear resolution.
Icon packs are specified by a controlling file called index.theme which each icon theme will have in it's top most directory. This is a simile text file in key/value format. This control file is used to specify many things, including an inherits clause that operates in the same way as that for the gtk theme files.
Tip #1:
If the current icon pack includes icons for the apps on the panel but the standard (Bluecurve) icons are showing, then this is probably because the names defined in the gktrc or iconrc specify a different name. E.g., the selected theme contains browser.svg but the theme might specify redhat-browser
There are 2 choices in resolving this problem:
Tip #2:
Also, may order *.desktop files in, e.g., /usr/share/applications, specify the file extension for the icon setting. This is not desirable especially in the transitory phase from png to svg (which is now supported by Gnome 2.x and is the preferred icon format for themes). Consider:
Name=SomeApp Icon=alacarte.png Comment=Some cool application Exec=someapp.sh Terminal=false Type=Application Categories=GNOME;Settings;DesktopSettings; NotShowIn=KDE;
In this .desktop file, the specified icon is alacarte.png, so if the current theme is an SVG theme and defines alacarte.svg, then the theme will fail to locate the specified icon and the next theme in the inherits clause will be searched. The only real solution here is to remove the .png extension from the Icon= setting. E.g.,
Icon=alacarte
Curors follow exactly the same rules as for icons, with $HOME/.icons and /usr/share/icons being searched for cursor sets. However, cursors are placed within a subdirectory called cursors. So, for example, the Lila icon and cursor theme might appear as:
Lila/index.theme
/icons/...
/cursors/...
Cursor selection is based on the inherits clause of the current icon theme. So, if an cursor theme called Cursors exists, then this entry should be added to the "inherits" clause of the index.theme of the default icon theme (/usr/share/icons/default or ~/.icons/default).
The other option is to simply replace the cursor directory of the default icon theme (as specified by /usr/share/icons/default/index.theme) with the prefered cursor directory.
The Gnome main menu or startmenu is built from the *.desktop files in /usr/share/applications, /usr/local/share/applications and, since Gnome 2.2 from ~/Desktop as well. These .desktop files are used by gnome-vfs(1), which is the foundation of Nautilus and the Gnome environment. Some KDE apps may install to /usr/share/applications/kde and gnome will use any *.desktop files in this location as well. In summary, *.desktop files are found in:
Note: Desktop entires, in more recent versions of gnome (2.10+), use ~/.local too
Todo: Discuss and describe ~/.local/share/applications and is relationship to Gnome and Nautilus
All *.desktop files, except those in ~/Desktop, affect all user desktops and so they'll appear in each users main menu (or startmenu). As an example, consider the skype.desktop file, which contains something like:
[Desktop Entry] Name=Skype Comment=Skype Exec=skype Icon=skype Terminal=0 Type=Application Encoding=UTF-8 Categories=Network;Application;
This tells the gnome-vfs what name, icon and tooltip to display as well as where to put the item and how to execute it. In this case, the above .desktop entry tells gnome-vfs to put the item in the Network subfolder of the Applications folder of the gnome main startmenu. Other attributes in a .desktop entry include i18N and L10N support, which appear as attributes like Name[lang], Comment[lang] and etc, where lang is a ISO-3166 2-letter country code like pl or de.
Any changes made to a .desktop file (including edits, deletes, new files) will appear in the startmenu in the appropriate group immediately (no need to re-run any compiler, other app, logout and back in or reboot). These files can be edited by hand, or they can be edited in Nautilus. Clearly, the user must have the appropriate permissions to edit any .desktop file. Files typically located in /usr/share/applications are owned by root. To edit a .desktop file, open Nautilus, which is listed as File Browser in Applications->Start Menu, and then enter the url:
applications:///
This will show the all users startmenu in the Nautilus browser. To edit a specific group, simply provide the name ofthe group to edit. E.g., to edit the group Internet provide the url:
applications:///Internet
Gnome has builds the main menu/startmenu from the .desktop files from serveral locations. There is no preference order or hierarchy to these locations. A .desktop file may exist in multiple locations, which will result in multiple gnome menu entries with the same name, icon and categorization. Note also that identical content can appear in distinct .desktop files, again resulting in duplicate menu entries.
In summary, the Gnome main menu/startmenu is built from the .desktop files found in:
The gdm graphical login screen themes are installed into /usr/share/gdm/themes. These can then be selected using the standard gui configure login screen tools such as gdmsetup and gdmphotosetup, or by directly editing the gdm config files in /etc/X11/gdm. Refer to gdm for more information on GDM setup
Installing 3rd party gtk engines can enhance theme rendering - by providing nice extras like transparency and other graphic techostuff. The magic chicken engine (mgicchikn) is recommended for use with the eXperience 1.0 theme
There are way too many gnome apps to discuss, but pretty much gnome maps mimetypes to an application. These can be changed using the gconf-editor.
For example the gnome pdf viewer gpdf(1) can be used to view Adobe PDF documents, or acroread(1) can be installed and set as the default reader.
Note, the current Adobe Acrobat linux release is for i386 (32-bit). This will work on the 64-bit architecture, but requires the 32-bit version of libGLU (which can co-exist with the 64-bit) version. So, for 64-bit, the libGLU should already be installed (mesa-libGLU.x86_64). Installing mesa-libGLU.i386 (the 32-bit version) should allow the 32-bit version of Acrobat reader to work just fine. Acrobat reader (v7) can be grabbed in rpm or tgz format from:
There is a slight quirk in the acrobat reader startup shell script when it comes to NIS+ or LDAP. It seems that the script performs some kind of wierd validation and looks in the local user database /etc/passwd for the current user. If this is not found, then the script exloads and doesn't start the reader. The workaround for this is to add a user to /etc/passwd (no need for an /etc/shadow entry) with the same userid and username. E.g., if the LDAP user is foo with id 1000, then add an entry to /etc/passwd like so:
foo:x:1001:200:Stuart Moorfoot:/home/foo:/bin/bash
Note that this is safe as there's no local shadow entry and so authentication is still performed by the authentication server (using whatever means is configured in pam like LDAP or NIS+ and similar).
Glade markup is a specification for gui's and widget layout. It is used by Gnome and many 3rd party gnome apps applications like zenity(1), gtkpod and many more.
The glade-2 app, provided with gnome, can be used to generate Glade markup. It provides a typical window builder environment where widgets can be added to forms and callbacks can be defined. The glade-2 project contains a typical autoconf environent, where the top level directory contains an autogen.sh. Run this to generate a configure script and then run that followed by make to build project.
A file containing glade markup can be executed with the glade-2 app.
Online tutorials
Starting from Fedora Core 6, Fedora now ships with X.Org version 7.1, and therefore with AIGLX. Compiz, the 3-D compositing window manager works fine under FC6 but the default installation configures gnome to use metacity. Enabling compiz requires a video card capable of rendering 3-D graphics via OpenGL and requires a suitable driver. Note: the out-of-the-box linux drivers for nVidia and ATI cards (these are the generic nv and radeon drivers) do not support OpenGL and 3-D rendering. ALso, the X.Org configuration must load the dri and glx modules, refer to xorg#4 for more info.
For example, most nVidia cards are OpenGL capable, but require that the nvidia driver be installed and enabled (see nvidia). Note that the standard xorg driver nv does not provide OpenGL and 3D support.
To enable compiz in gnome, from the start menu, choose startmenu System 》preferences 》Desktop Effects and select the Enable Desktop Effects button. This will start the compositing window manager instead of metacity when gnome is started. The Desktop Effects app can also be started from the command line with:
bash $ desktop-effects
The compiz project was started by Novel and is built over the XGL (openGL libaries). Note that compiz-vanilla has forked a separate compositing window manager called beryl.
When using gnome, compiz hooks into gconf and specifies itself as the window manager (instead of metacity). This is done by specifying compiz for the window_manager property in gnome-session attributes. This can be done using the gconf-editor or by directly editing the gnome-session %gconf file:
bash $ vim $HOME/.gconf/apps/gnome-session/rh/%gconf.xml
For example, after setting compiz, the gnome session %gconf file should look something like:
bash $ cat $HOME/.gconf/apps/gnome-session/rh/%gconf.xml
<?xml version="1.0"?>
<gconf>
<entry name="window_manager" mtime="1174973582" type="string">
<stringvalue>compiz</stringvalue>
</entry>
</gconf>
The Desktop Effects app will perform the above and provides the user with a simple interface to configuring compiz and desktop effects. Desktop effects is provided in the gnome system menu under: System 》Preferences 》Look and Feel 》Desktop Effects.
Compiz provides it's eye candy such as cube for desktop switching, Fade for window change of focus and etc through plugins.
The folowing urls have useful compiz documentation:
The compiz project has forked into Beryl-Project.org. The community maintained tree of Compiz (called Compiz-QuinnStorm) will be moved into a project called Beryl, a fork of Compiz. See Beryl window manager (wikipedia)
The Compiz project (formely compiz.net) has forked the Beryl Project (http://beryl-project.org). Beryl is a 3-D compositing window manager over XGL and was forked from compiz. See Beryl window manager (wikipedia)
Beryl is now included in the Fedora Extras repository and can most easily be installed via yum. The beryl meta-packages beryl-gnome and beryl-kde will pull in the required beryl packages. E.g., to use beryl with gnome:
bash # yum install beryl-gnome
After beryl is installed, it can be started with:
bash $ beryl-manager
If Beryl is already running, then starting beryl-manager will open the beryl configuration panel.
If beryl works as expected, then it can be started automatically with gnome by configuring the gnome session properties:
bash $ gnome-session-properties
Then add beryl-manager to the Startup Programs section. If Beryl doesn't start correctly (the Beryl splash screen doesn't appear during login) it may be necessary to remove the gnome session %gconf file:
bash $ rm ~/.gconf/apps/gnome-session/rh/%gconf.xml
Then simply log out and log back in again and GNOME should run with beryl as the window manager. If, after doing that, when you log in, the system closes the session and goes again to the login screen, download and install the lastest drivers for your videocard (remember to stop the X server before installing the drivers). After rebooting the system, beryl will work fine. Of course, check that your video card is in the list of supported videocards.
To get the desktop cube effect working, be sure that the following gconf properties are set:
bash $ gconftool-2 --type int --set /apps/compiz/general/screen0/options/hsize 4 bash $ gconftool-2 --type int --set /apps/compiz/general/screen0/options/number_of_desktops 1
For more information and documentation on Berly and Compiz, see:
13. Reduced Resources in Gnome
The default window manager Metacity has the reduced_resources setting in GConf disabled by default. This setting controls aspects of the window manger such as displaying the window contents on resize (a resource hungry operation). In windoze, this is called Show window contents whilst dragging and is an option that frankly, should be left with windoze. However, this option is in metacity and can be disabled by setting the reduced_resouces setting to true, which can be done using the gconftool-2 as:
bash $ gconftool-2 --set /apps/metacity/general/reduced_resources --type bool true
The version of Gnome can be determined using man?gnome-about. Executing the gnome-about will open a ui with the gnome version.
bash $ gnome-version
Stuart Moorfoot 29 Dec 2004 foo@bund.com.au