Customizing GTK Apps

If you are used to GNOME, you might want to learn how to change your theme without using the GNOME Theme Manager. GTK apps first try to get their themeing information through an XSettings provider, such as gnome-settings-daemon or xsettings-kde, and in absence of these reverts to files, ~/.gtkrc for gtk2 apps, ~/.config/gtk-3.0/settings.ini for gtk3 apps.

=Manually=

Initial Setup
First, create a file called ".gtkrc-2.0" in your home folder, and put this line in it:

include '/home/ /.gtkrc.mine'

Next, create ".gtkrc-1.2-gnome2" and add the same line. Now create ".gtkrc.mine".

GTK Themes
To apply a theme, add this line to .gtkrc.mine:

gtk-theme-name = "Clearlooks"

replacing the example name with the name to the theme you want to use (probably in /home/ /.themes).

For GTK3 apps
create the file ~/.config/gtk-3.0/settings.ini with contents:

[Settings]

gtk-icon-theme-name = 

gtk-theme-name = 

Icon Themes
To apply an icon theme, add this line to '.gtkrc.mine':

gtk-icon-theme-name = "Tango"

The name of the icon theme can be found in the index.theme file in the theme folder (probably in ~/.icons).

Fonts
To change the fonts of GTK apps, add this to your '.gtkrc.mine' file:

style "schrift" { font_name = "DejaVu Sans 10" } widget_class "*" style "schrift" gtk-font-name = "DejaVu Sans 10"

Toolbars
To change the look of certain apps' toolbars (like gedit), add one of the following lines to your '.gtkrc.mine' file:

gtk-toolbar-style  = GTK_TOOLBAR_ICONS              #Only icons gtk-toolbar-style  = GTK_TOOLBAR_TEXT	             #Only text gtk-toolbar-style  = GTK_TOOLBAR_BOTH	             #Both icons and text gtk-toolbar-style  = GTK_TOOLBAR_BOTH_HORIZ	     #Icons and text next to the icons

You can also change the size of the icons: gtk-toolbar-icon-size = 16,16

=Automatically=

There a few apps that you can use to change your theme without invoking gnome-settings-daemon:


 * LXappearance (Support gtk2 and gkt3)
 * gtk-theme-switch
 * gtk-chtheme
 * gnome-color-chooser

=Example=

The following is an example '.gtkrc.mine' file:

include "/usr/share/themes/Clearlooks/gtk-2.0/gtkrc" style "schrift" { font_name = "Myriad Web 9" } widget_class "*" style "schrift" gtk-font-name = "Myriad Web 9" gtk-icon-theme-name = "Crashbit" gtk-toolbar-style  = GTK_TOOLBAR_ICONS
 * 1)      GTK       #
 * 1)      GTK       #
 * 1)     FONTS      #
 * 1)     FONTS      #
 * 1)     ICONS      #
 * 1)     ICONS      #
 * 1)    TOOLBARS    #
 * 1)    TOOLBARS    #