Search:  
Gentoo Wiki

GTK_Engines_and_Themes

Concerns or Compliments? Please use the Discussion section.

Contents

GTK Engines and Themes - An Explanation

This page tries to explain what a GTK Engine is and how a Theme is applied. Before this can be done you need to know what exactly a theme is. What an end user expects to be a theme is often much more than what a gnome-theme provides. Here is a table that translates the parts of a theme a user expects to what gnome provides.

User's ThemeGnome Theme PartsAppearance Tab(s)
Controls, Buttons, etc GTK Engine + gtkrc fileControls
Window BordersMetacity ThemeWindow Borders
Fancy ColorsColorscheme in a gtkrc fileColors
Nice Icons & Mouse PointersIcon setIcons, Pointers

These four seperate items control what one would call a theme.

In a limited way, these can be editted in the Gnome Appearance application. To get there:

System > Preferences > Appearance
Next click "Customize..."

Here you can select the parts from theme packages installed in either

/usr/share/themes/

or

~/.themes


GTK Engine

The engine supplies all artwork and some code to put them on the screen. These elements are completely colorless and can be styled the way you want them to be These need to be compiled and installed to make them work. If the engine was installed succesfully, it should appear in the Controls tab of Appearance with every flavour it provided a gtkrc file for. If these packages contain any premade theme parts they will be placed in:

/usr/share/themes

To see what GTK Engines are available in portage, run

emerge --search gtk-engines

gtkrc file

This is a file that contains settings for the placement and actions of the GTK Engine elements, and what colors it will have. You will probably not want to touch these settings except for the colors. These colors can be easily editted in the Appearance application.

The file is located here in a theme package:

MyTheme/gtk-2.0/gtkrc

A gtkrc file can be forced to be used by making it a .gtkrc-2.0 file in your home directory (not recommended):

cp ~/.themes/MyTheme/gtk-2.0/gtkrc ~/.gtkrc-2.0

Metacity Theme

Metacity is Gnome's Window Manager. It controls the behaviour of the windows and the looks of the border. A theme for metacity is a set of images, yet again colorless so they can be styled with the colorscheme. It also includes an xml file to define the behaviour of those images. The files are located here in a theme package:

MyTheme/metacity-1/

For more advanced looks with transparancy and such, you can have a look at Compiz + Emerald for your window borders. Emerald replaces metacity and because of this the Window Border setting in Appearance is ignored. Emerald has it's own border gallery.

Icon sets

These are pretty straight-forward, a set of icons, but they can be in several places. In you home directory:

~/.icons

In the theme package (for this they need to be included in the gtkrc file):

MyTheme/gtk-2.0/icons

Global:

/usr/share/icons/

A Theme Package

The most basic of themes is a folder in your ~/.themes with in this folder a file called index.theme. In this file we can define the four elements that make a theme. This is the same as picking custom elements in Appearance and saving it as a new theme.

The file looks like this, I think it will be obvious what it means:

[Desktop Entry]
Type=X-GNOME-Metatheme
Name=My Brand New Theme
Comment=This Theme is super Awesome
Encoding=UTF-8

[X-GNOME-Metatheme]
GtkTheme=Aurora
IconTheme=MacOS-X
MetacityTheme=Clearlooks

This package can contain metacity themes, a gtk engine style and an icon set as described above. The final package may look like this:

* MyTheme/
  * gtk-2.0/
    * icons/
    * gtkrc
  * metacity-1/
  * index.theme
Retrieved from "http://www.gentoo-wiki.info/GTK_Engines_and_Themes"

Last modified: Fri, 05 Sep 2008 08:09:00 +0000 Hits: 959