Home of Rob
Menu
GTK Themes
Ok, so I had to write a relatively simple GTK application using python. The system on which it runs is an embedded PC with a stripped down version of Debian Linux (the hard disk is small so only the bare minimum software is installed). This meant that no gnome, kde or other desktop theme is installed. The X windows server is present, though, which enables me to view the application.
The problem, then, was how to customise the look/feel of my application. Looking through the documentation online it's fairly easy to change a button's colours (foreground, background etc) for different settings (pressed, highlighted etc) but nothing for the actual appearance of the button. This is all set by the system theme. But with no desktop I had no system theme!
The answer is to install a specific gtk theme. Themes can be downloaded from a number of places (for example here and here). They can be installed with gtk-theme-switch (or gtk-theme-switch2 for gtk2 applications). These I installed via apt-get (fortunately I have an internet connection).
During this process I did have problems, however, with gtk-theme-switch complaining about not being able to find pixmap. Unable to locate theme engine in module_path: pixmap. It turns out that themes require engines, and these are not installed with the theme. To install the pixmap engine for gtk, try the following:
apt-get install gtk-engine-pixmap
After this, to install them for gtk2 try:
apt-get install gtk2-engines
Or you can go for the brute-force approach and try:
apt-get install gnome-themes
This should get you everything possibly needed.
Of course, if you want to configure your application specifically then you'll need to write your own gtk theme. This isn't something I've looked into just yet.