Customizing GTK Apps

From awesome

Jump to: navigation, search

If you are used to GNOME, you might want to learn how to change your theme without using the GNOME Theme Manager, as it relies on a constantly running process called gnome-settings-daemon which wastes resources. You can theme GTK apps manually without this process, however.

Contents

[edit] Manually

[edit] Initial Setup

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

include '~/.gtkrc.mine'

You may replace ~ with '/home/username'. Next, create ".gtkrc-1.2-gnome2" and add the same line. Now create ".gtkrc.mine".

[edit] GTK Themes

To apply a theme, add this line:

include '/usr/share/themes/Clearlooks/gtk-2.0/gtkrc'

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

[edit] 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).

[edit] 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"

[edit] 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

[edit] Automatically

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

[edit] Example

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

##################
#      GTK       #
##################

include "/usr/share/themes/Clearlooks/gtk-2.0/gtkrc"


##################
#     FONTS      #
##################

style "schrift"
{
font_name = "Myriad Web 9"
}
widget_class "*" style "schrift"
gtk-font-name = "Myriad Web 9"


##################
#     ICONS      #
##################

gtk-icon-theme-name = "Crashbit"


##################
#    TOOLBARS    #
##################

gtk-toolbar-style   = GTK_TOOLBAR_ICONS
Personal tools