GTK themes

All the ROX applications use GTK. Everything inside the window frame of a GTK application is drawn by GTK, while the frame itself (the titlebar and resize frame) is drawn by the window manager.

The basic goal of the theme system is to keep programmers away from graphic design. The programmer says to GTK "display a button". The theme designer says to GTK "draw buttons like this". For more information, see The GTK+ Theme Architecture.

Downloading themes

ROX uses GTK 2, so make sure you get a GTK2 theme if you want to change the style of the menus and other user interface widgets. To install a GTK theme:

  1. Place your downloaded theme into the hidden directory ~/.themes/
  2. Run the LookAndFeel configuration applet and choose the theme from the menu there (this only works if you're using ROX-Session; other session managers will provide their own ways to set the theme).

You can find lots of themes at http://themes.freshmeat.net.

Manual customization

On startup, GTK reads the file ~/.gtkrc-2.0. You can edit this file to customize the appearance of your programs. See the following pages for some examples.

Themes only seem to change the widget colours, not images

Make sure you have the appropriate theme engine installed (eg gtk2-engines-pixbuf).

How can I theme the toolbar icons?

ROX-Filer uses the standard Gtk stock icons system to change the toolbar icons. Put something like this
in your ~/.gtkrc-2.0 file:

pixmap_path "/path/to/icons"
 
style "normal" {
  stock["gtk-close"] = {{"close-icon.png"}}
  stock["gtk-go-up"] = {{"up-icon.png"}}
  stock["gtk-home"] = {{"home-icon.png"}}
  stock["gtk-refresh"] = {{"refresh-icon.png"}}
  stock["gtk-zoom-in"] = {{"zoom-in-icon.png"}}
  stock["gtk-zoom-fit"] = {{"zoom-fit-icon.png"}}
  stock["gtk-jump-to"] = {{"jump-to-icon.png"}}
  stock["gtk-sort-ascending"] = {{"sort-icon.png"}}
  stock["gtk-help"] = {{"help-icon.png"}}
  stock["rox-show-hidden"] = {{"hidden-icon.png"}}
  stock["rox-show-details"] = {{"details-icon.png"}}
  stock["rox-select"] = {{"select-icon.png"}}
}
 
widget "*" style "normal"

See the list of stock icons in the Gtk documentation for details.

Theming panels

How do I set a font, colour or background image for the panels?

Put something like this in your ~/.gtkrc-2.0 file:

style "panel-style" {
  bg[NORMAL] = "#efb47c"
  font_name = "Sans 5"
}
widget "rox-panel.*" style "panel-style"

Theming the background of filer windows

My GTK theme makes my filer background a different color; how do I make it white again?

Put something like the following in your ~/.gtkrc-2.0 file:
Note: to prevent this file from being overridden when changing themes use ~/.gtkrc.mine
instead

style "rox" = "default"
{
  bg[NORMAL] = "#ffffff"
  bg[ACTIVE] = "#ffffff"
}
widget_class "*Collection*" style "rox"

Next, restart ROX-Filer (or you X session). You can just restart ROX by killing the ROX-Filer process : under Linux, use killall ROX-Filer and restart it. Don't use killall under Solaris.

Other widget_class backgrounds you may like to change include:

  • GtkToolbar - the toolbar at the top of the window
  • GtkMenu - menus

but remember that this will affect all GTK applications.

How do I set a background image for ROX filer windows?

This is similar to the previous question. Put something like the following in your ~/.gtkrc-2.0 file:
Note: to prevent this file from being overridden when changing themes use ~/.gtkrc.mine
instead

pixmap_path "/home/yourhome/images"
style "rox" = "default"
{
  bg_pixmap[NORMAL] = "roxbg.png"
}
widget_class "*Collection*" style "rox"

Bu sure that roxbg.png is in the path you use in the pixmap_path directive. The image will be tiled to fill the whole ROX filer window. Next, restart ROX-Filer (or you X session). You can just restart ROX by killing the ROX-Filer process : under Linux, use killall ROX-Filer and restart it.

Further reading

See the GTK Theming Tutorial for more information.