Personal modifications of GTK2 themes

Ever since I tried out a NeXT-based theme I’ve loved having both an up- and down-stepper at the bottom of every scrollbar. I’ve liked this so much that I’ve regularly discarded GTK2 themes that look awesome simply because they didn’t have this little usability feature.

The other day I took a quick look at the Lush theme, which does have the two steppers. I’ve always suspected GTK2 is brilliant and now I know. I found the following lines in the theme:

GtkScrollbar::has_backward_stepper = 1
GtkScrollbar::has_secondary_forward_stepper = 0
GtkScrollbar::has_forward_stepper = 1
GtkScrollbar::has_secondary_backward_stepper = 1

Basically it looks like the standard theme engine can handle up to four steppers, and each can be visible or not. Brilliant! Now I only need to modify my favourite theme (Simple) adding those lines to it. I don’t like modifying system files, so adding the lines to the file in /usr/share/themes/ wasn’t very appealing. After asking on the Gnome-Love mailing list I found out that one file where I could modify all themes is ~/.gtkrc-2.0. So, this is now the full contents of that file:

style "default"{
  GtkScrollbar::has_backward_stepper = 1
  GtkScrollbar::has_secondary_forward_stepper = 0
  GtkScrollbar::has_forward_stepper = 1
  GtkScrollbar::has_secondary_backward_stepper = 1
}

This works fine for the Simple theme since it doesn’t explicitly set any of those variables itself. The theme Lush however does set those variables and the theme will override the user’s own settings. Using strace on a GTK2 application it’s easy to see that the theme settings are loaded after the user’s. There also doesn’t seem to be any user-specific file loaded after the theme itself, so I’m still wondering how a user can override the settings of a theme.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>