The article I wrote over two weeks ago shows how you can make GIMP follow the same theme you choose for other programs like Pidgin, with the help of a third-party program called Gimp Themes. At the end of the post I also mentioned Inkscape, which I had failed to convince to follow things the same way.

Well, I was just asking about Inkscape on its IRC channel, on the day after writing the previous article, about how to do that, and thanks to aho, there is indeed a really simple way to tell GIMP and Inkscape to use the same GTK+ engine as Pidgin does (because Pidgin installs a separate GTK+ runtime engine instead of using its own). Only, it involves the filesystem entirely, so if you’re really afraid of modifying program files and folders, don’t read this. Otherwise, you’re welcome.

Indeed this does present a little risk, because if a GTK+ application comes with its own GTK+ engine to use, it’s for a good reason. It might end up like taking candy from a baby. It’s easy to take what belongs to it, and also easy to make it whine. I’ve been safe, so far.

Again, this is for Windows. All you GNOME users can just return to your little abodes and go about your dailies…

Prerequisites

All you need is a GTK+ application. Really. In this example I follow my situation, so I pick Inkscape and GIMP.

1. Install your software

Download and install your software if you haven’t already. Like the previous tutorial, I’ll assume the default paths.

Pidgin setup
Pidgin setup

Inkscape setup
Inkscape setup

GIMP 2.4.6 setup window
GIMP setup

When you choose a theme in Pidgin (in my example it’s Clearlooks), Inkscape (and, if you didn’t follow the last tutorial, GIMP too) ignores it and continues to use MS-Windows, as you can see below:

Inkscape and GIMP not following Pidgin\'s theme
Inkscape and GIMP not following Pidgin’s theme

There are two things we have to do: copy the theme’s engine DLL and gtkrc files to the GTK+ application’s themes folder, and tell the application not to use its own GTK+ environment.

2. Copy your theme files

As above, I used Clearlooks. Assuming GTK+’s default path is %ProgramFiles%\Common Files\GTK\2.0, you can find your theme’s engine file in lib\gtk-2.0\2.10.0\engines and its folder in share\themes. In my case, that would be lib\gtk-2.0\2.10.0\engines\libclearlooks.dll and share\themes\Clearlooks respectively.

Copy them to %ProgramFiles%\<your GTK program folder>, in the respective folders.

For example, for Inkscape and GIMP, I’d copy these files to %ProgramFiles%\Inkscape and %ProgramFiles%\GIMP-2.0 respectively. That means I’d get:

  • Inkscape
    • %ProgramFiles%\Inkscape\lib\gtk-2.0\2.10.0\engines\libclearlooks.dll
    • %ProgramFiles%\Inkscape\share\themes\Clearlooks
  • GIMP
    • %ProgramFiles%\GIMP-2.0\lib\gtk-2.0\2.10.0\engines\libclearlooks.dll
    • %ProgramFiles%\GIMP-2.0\share\themes\Clearlooks

You have the theme files ready for the program to use. Now to tell it to use the main GTK+ engine, otherwise it will just continue to use its own.

3. Disable the GTK+ engine gtkrc file

Look in %ProgramFiles%\<your GTK program folder>\etc\gtk-2.0 to find the gtkrc file. All you have to do is to rename or delete the file. I’d prefer to rename it. When the application can’t find the file, it falls back to another GTK+ library which would be the one stored in the Common Files folder.

That’s really it:

Pidgin, Inkscape and GIMP sharing the same GTK+ runtime
Pidgin, Inkscape and GIMP sharing the same GTK+ runtime

If you’re having trouble, post comments and I’ll see if I can help. Don’t take me for a guru though, I’m not a GTK+ meister.

Back to top