ThemeEngineTricks

Theme Engine Hacking Tricks

This page contains a handful useful tricks to get going on some GTK+ theme engine hacking. This page was created during initial Hardy artwork brainstorm.

Get Hold of TheWidgetFactory

Richard Stellingwerff wrote a little helper application for testing themes. It is the one you see in all those standard theme screenshots. Install it by copy pasting the command below into a terminal

sudo apt-get install thewidgetfactory

Run it like this to preview your theme(s)

twf

Local Installation of Engine

There is a secret way to use a theme engine without compiling it. This is useful if you want to apply a hack to, say, Murrine, but don't want uninstall the system wide Murrine.

The trick is to create a symlink to the engine in ~/.gtk-2.0/engines. I usually symlink the engine directly here from my development tree.

When you've compiled your engine (not installed it) the engine lib will be placed in mytheme/.libs/. I create the symlink like this:

ln -s /home/mikkel/Projects/mytheme/.libs/libmytheme.so /home/mikkel/.gtk-2.0/engines

To use it just refer to mytheme as the engine in your gtkrc file(s).

Load Appearance CApplet from Command Line

Run the theme changer from the command line. It may display useful debugging info. In Gutsy

gnome-appearance-properties

Beware of GLib Type Duplicates

If you just go ahead on create a hacked up Murrine or other engine for your self beware that GLib does not like different modules registering types of the same name. If you are hacking on Murrine and your custom engine is called Marinade then run the following from the top project dir to replace relevant type names

sed -i -e "s@MurrineRcStyle@MarinadeRcStyle@g" src/murrine_rc_style.c
sed -i -e "s@MurrineRcStyle@MarinadeRcStyle@g" src/murrine_rc_style.h
sed -i -e "s@MurrineStyle@MarinadeStyle@g" src/murrine_style.h
sed -i -e "s@MurrineStyle@MarinadeStyle@g" src/murrine_style.c

MikkelKamstrupErlandsen/ThemeEngineTricks (last edited 2008-08-25 05:20:35 by 0x3e42da90)