Generating Metacity theme previews: setting colours



Hello all.

I've been trying to write a script or a program that will automatically
generate Metacity theme previews, similar to the ones generate for the
Appearance program.

As far as I can tell, there is no simple way to do this on the
command-line with the existing GNOME and Metacity utilities. So I
decided to dive into C, Autoconf and Automake and look at GNOME CC's
source code.

I finally managed to get some working code that almost does want I want.
Here's the relevant piece of code [0]:

GnomeThemeInfo info = {GNOME_THEME_TYPE_REGULAR};
info.name = metacity_theme_name;
pix = generate_metacity_theme_thumbnail(&info);

I copied gnome-theme-info.?, gtkrc-utils.? and theme-thumbnail.? from
release 2.32.1.

This almost works. The only problem with it is that it keeps the default
GTK colours set on my system (an ugly orange on Ubuntu 10.10). I can't
find a way to stop this. Changing the generate_metacity_theme_thumbnail
to pass a scheme struct to generate_theme_thumbnail doesn't seem to
work. Neither does modifying GTK2_RC_FILES environment variable.

In case you're wondering why I need this, it's part of my work on
Universal/Coordinating Themes [1], and Epidermis [2]. (BTW, I would love
to hear your input on those projects)

Any help would be greatly appreciated. As I said, I'm still new to C,
but I'm not new at programming so don't feel I need spoon-feeding.

Thanks.

David D Lowe

[0]
https://code.launchpad.net/~flimm/+junk/theme-thumbnailer
Or just use Bazaar directly:
bzr branch lp:~flimm/+junk/theme-thumbnailer

[1]
http://lists.freedesktop.org/archives/xdg/2010-February/011274.html

[2]
http://epidermis.tuxfamily.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]