This chapter describes themes, the theme settings that are available in the desktop, how to install options for theme settings, and how to create a custom option.
A theme is a group of coordinated settings that specifies the visual appearance of a part of the desktop. Users can choose themes to change the appearance of the desktop.
A theme contains settings that affect different parts of the desktop, as follows:
The controls setting for a theme determines the visual appearance of windows, panels, and panel applications. The controls setting also determines the visual appearance of the GNOME-compliant interface items that appear on windows, panels, and panel applications, such as menus, icons, and buttons. Some of the controls setting options that are available are designed for special accessibility needs.
To change an option for the controls setting, users start the Theme
preference tool, click on the Theme Details button, then select the option from the Controls
tabbed section in the preference tool.
The window frame setting for a theme determines the appearance of the frames around windows only.
To change an option for the window frame setting, users start the Theme
preference tool, click on the Theme Details button, then select the option from the Window Border tabbed section in the preference tool.
The icon setting for a theme determines the appearance of the icons on panels and the desktop background.
To change an option for the icon setting, users start the Theme
preference tool, click on the Theme Details button, then select the option from the Icons
tabbed section in the preference tool.
Each theme has an index file which defines the characteristics of the theme. The name of the index file is /usr/share/themes/theme-name/index.theme.
The following is a sample theme index file:
[Desktop Entry] Type=X-GNOME-Metatheme Name=High Contrast Large Name[es]=Alto contraste grande Comment=Large black-on-white text and icons Comment[es]=Textos e iconos grandes en negro sobre blanco Encoding=UTF-8 [X-GNOME-Metatheme] GtkTheme=HighContrastLargePrint IconTheme=HighContrast MetacityTheme=Atlanta ApplicationFont=sans 18
The following table describes the keys in theme index files:
Table 3–1 Keys in Theme Index Files
Index File Key |
Description |
---|---|
Type |
Specifies that this theme determines the appearance of several theme options, such as controls, window frames, and icons. |
Name |
The name of the theme. This is
the name of the theme that is displayed in the |
Comment |
A brief description of the theme.
This is the text that is displayed under the name of the theme in the |
GtkTheme |
Corresponds to the controls setting in the Theme Details dialog in the |
IconTheme |
Corresponds to the icons setting in the Theme Details dialog in the |
MetacityTheme |
Corresponds to the window frame setting in the Theme Details dialog in the |
ApplicationFont |
Corresponds
to the application font setting in the |
You can add a new option
for the controls setting. When you add a new option, users can select the
option from the Theme Details dialog in the Theme
preference tool. Controls options reside in the /usr/share/themes directory. The typical structure of a controls
option in the file system is as follows:
/usr/share/themes/option-name/gtk-2.0/gtkrc
/usr/share/themes/option-name/pixmaps/*.*
Typically, a new option for the controls setting is supplied as a .tar.gz file. To install the new controls option, unzip the .tar.gz file, then untar the .tar file into the /usr/share/themes directory.
Users can install their own options for the controls setting. If a user installs an option for the controls setting, the option is stored in the $HOME/.themes directory.
You can add a new option
for the window frame setting. When you add a new option, users can select
the option from the Theme Details dialog in the Theme
preference tool. Window frame options reside in the /usr/share/themes/option-name/metacity-1
directory. The typical structure of a window frame option in the file system
is as follows:
/usr/share/themes/option-name/metacity-1/metacity-theme-1.xml
/usr/share/themes/option-name/metacity-1/*.*
Typically, a new option for the window frame setting is supplied as a .tar.gz file. To install the new window frame option, unzip the .tar.gz file, then untar the .tar file into the /usr/share/themes directory.
Users can install their own options for the window frame setting. If a user installs an option for the window frame setting, the option is stored in the $HOME/.themes directory.
You can add a new option for the icons
setting. When you add a new option, users can select the option from the Theme Details dialog in the Theme
preference
tool. Icons options reside in the /usr/share/icons/option-name directory. The typical structure of an
icons option in the file system is as follows:
/usr/share/icons/option-name
/usr/share/icons/option-name/image-size/ui-category/*.*
The ui-category directories are apps, devices, emblems, filesystems, or mimetypes.
Typically, a new option for the icons setting is supplied as a .tar.gz file. To install the new icons option, unzip the .tar.gz file, then untar the .tar file into the /usr/share/icons directory.
Users can install their own options for the icons setting. If a user installs an option for the icons setting, the option is stored in the $HOME/.icons/option-name directory.
The Java Desktop System contains the following types of icon:
Icons that are used internally by GTK+ applications, or GTK+
stock icons. Users can use the Controls tabbed section
in the Theme Details
dialog to specify a set of
these icons for their desktop.
Icons that are used to represent applications in the Main Menu, and in the file manager. Users can use the Icons tabbed section in the Theme Details
dialog to specify a set of these icons for their desktop.
The Java Desktop System provides several themes that are designed for users with special visual needs. For example, some of the themes are designed for users with low vision. Several versions of icons might be required so that the system can display the icon properly in each theme. You can create the icons in several formats and sizes. For example, you can create icons in Portable Network Graphic (PNG) format. The suggested size of icons for the Java Desktop System is 48 pixels by 48 pixels. This is the most suitable size at which the icons can be successfully scaled up and down.
When you install a new icon, create the following 48 × 48 pixel versions of the icon:
Regular icon
Low contrast icon
High contrast icon
Inverse high contrast icon
Install the icons in the image files location that is specified for the theme in To Install a New Controls Option.
For example, to add GTK+ icons to the HighContrastLargePrint theme, perform the following steps:
Add the icons to the /usr/share/themes/HighContrastLargePrint/pixmaps directory.
Modify the /usr/share/themes/HighContrastLargePrint/gtk-2.0/gtkrc file to associate the icon with a GTK stock icon identifier.
To add Main Menu icons for new applications to the HighContrastLargePrint theme, install the icons to the /usr/share/icons/HighContrastLargePrint/48x48/apps directory.
For more information about how to create icons for application launchers and panels, see the following URL:
http://www.freedesktop.org/Standards/icon-theme-spec
If the options for the controls setting are not suitable for the needs of your users, you can create a custom controls option. To create a custom controls option, perform the following steps:
Create a directory structure for the option in the /usr/share/themes directory. Use the same directory structure that other options use. For example, to create an option that is called SmallPrint, create the following directories:
/usr/share/themes/SmallPrint
/usr/share/themes/SmallPrint/gtk-2.0
Locate the gtkrc file that is closest to meeting the needs of your users. Copy the file to the gtk-2.0 directory of the new option.
Open the gtkrc file in a text editor, and modify the attributes of the interface elements as required.
If the new option includes images, install the images for the new option in the pixmaps directory of the new option. If the new option only uses images from another option, you do not need to create copies of the images for the new option. Instead, ensure that the reference to the images in the pixmap_path entry in the gtkrc file is correct.
Users can now choose the new option for the controls setting.
For more information about gtkrc files, see the following URL:
http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html