# Installing Themes

This chapter describes the types of theme that are available in the GNOME desktop, how to install themes, and how to create a custom theme.

## Introduction

A theme is a group of coordinated settings that specifies the visual appearance of a part of the GNOME desktop. Users can choose themes to change the appearance of the desktop.

The following types of theme affect different parts of the GNOME desktop:

Desktop themes

- Desktop themes determine the visual appearance of windows, panels, and applets. Desktop themes also determine the visual appearance of the GNOME-compliant interface items that appear on windows, panels, and applets, such as menus, icons, and buttons. Some of the desktop themes that are available in GNOME are designed for special accessibility needs. Users can choose a desktop theme from the Widget Theme tabbed section in the Theme preference tool.

Window frame themes

- Window frame themes determine the appearance of the frames around windows only. Users can choose a window frame theme from the Window Frames tabbed section in the Theme preference tool.

## To Install a Desktop Theme

Desktop themes reside in the `/usr/share/themes` directory. The typical structure of a desktop theme in the file system is as follows:

Theme file | `/usr/share/themes/`theme_name`/gtk-2.0/gtkrc`
Image files | `/usr/share/themes/`theme_name`/pixmaps/*.*`

Typically, a new desktop theme is supplied as a `.tar.gz` file. To install the new desktop theme, unzip the `.tar.gz` file, then untar the `.tar` file into the `/usr/share/themes` directory.

If a user adds a desktop theme, the theme is stored in the `$HOME/.themes` directory.

Users can install their own desktop themes. If a user installs a desktop theme, the theme is stored in the `$HOME/.themes` directory.

## To Install a Window Frame Theme

Window frame themes reside in the `/usr/share/themes/`theme_name`/metacity-1` directory. The typical structure of a window frame theme in the file system is as follows:

Theme file | `/usr/share/themes/`theme_name`/metacity-1/metacity-theme-1.xml`
Image files | `/usr/share/themes/`theme_name`/metacity-1/*.*`

Typically, a new window frame theme is supplied as a `.tar.gz` file. To install the new window frame theme, unzip the `.tar.gz` file, then untar the `.tar` file into the `/usr/share/themes` directory.

Users can install their own window frame themes. If a user installs a window frame theme, the theme is stored in the `$HOME/.themes` directory.

## Installing Icons for Themes

The GNOME desktop 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. The themes contain several versions of each icon so that the icon can be displayed in each theme.

You might need to install a new icon for an application. When you install a new icon, you must create several versions of the icon, so that the icon displays correctly in the themes. You can create the icons in several formats, for example Portable Network Graphic (PNG) format. The suggested size of icons for the GNOME desktop is 48 pixels by 48 pixels. At this size, most themes can rescale the icons.

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

If possible, create 16 × 16 pixel versions of the each of the icons above also, for themes that do not require large print.

Install the icons to the image files location that is specified for the theme in themes-3 or themes-5. For example, to add icons to the HighContrast theme, add the icons to the `/usr/share/themes/HighContrast/pixmaps` directory. Add references to the icons to the relevant theme files. For example, to add icons to the HighContrast theme, add references to the icons to the `/usr/share/themes/HighContrast/gtk-2.0/gtkrc` file.

The instructions above apply only to the following types of icon:

- Icons that are used within applications in the GNOME desktop.

- Icons that are used internally by GTK+ applications, or GTK+ stock icons.

For more information on how to create icons for application launchers and for panels, see http://www.freedesktop.org/standards/icon-theme-spec.html.

## To Create a Custom Desktop Theme

If the desktop themes that the GNOME desktop provides are not suitable for the needs of your users, you can create a custom desktop theme. To create a custom desktop theme, perform the following steps:

1. Create a directory structure for the theme in the `/usr/share/themes` directory. Use the same directory structure that other themes use. For example, to create a theme that is called SmallPrint, create the following directories:

   - `/usr/share/themes/SmallPrint/gtk-2.0`

   - `/usr/share/themes/SmallPrint/pixmaps`

2. Locate the `gtkrc` theme file that is closest to meeting the needs of your users. Copy the file to the `gtk-2.0` directory of your new theme.

3. Open the `gtkrc` file in a text editor, and modify the attributes of the interface elements as required.

4. If the new theme includes images, install the images for the new theme in the `pixmaps` directory of your new theme. If the new theme uses images from another theme, you do not need to create copies of the images for the new theme. 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 theme.

For more information on `gtkrc` files, see http://developer.gnome.org/doc/API/2.0/gtk/index.html.