06 June 2008

Theme Info Script

I cooked up a little python script to print basic theme info. Here is what it looks like:



You can download the script here: https://sourceforge.net/project/showfiles.php?group_id=233270 . Alternatively, you can check out the latest version from cvs:

$ mkdir themeinfo
$ cd themeinfo
$ cvs -d:pserver:anonymous@themeinfo.cvs.sourceforge.net:/cvsroot/themeinfo login
$ cvs -z3 -d:pserver:anonymous@themeinfo.cvs.sourceforge.net:/cvsroot/themeinfo co -P trunk

You must make it executable and use python to execute it::
chmod +x themeinfo.py
python themeinfo.py


There are a few prerequisites to get the script to work. First, check the options around line 28. You need to set them up to match your system. The default setup is for GNOME. There are a few other options, but I am working on support for KDE, Xfce, and Fluxbox. If you have any tips or suggestions, please leave a comment!

GTK and Icons

Unless you are using gnome-settings-daemon , you must specify your GTK and icon themes in your .gtkrc.mine file with the following formatting:
include '/home/daniel/.themes/MurrinaAurantium/gtk-2.0/gtkrc'
gtk-icon-theme-name = "Crashbit"
It doesn't matter where these lines are in the file, but if you include multiple external gtkrc files or specify different icon themes in different styles, the script will only print the first one as the theme name.

Wallpaper

In order to get the wallpaper function to work, you must either set the background with nautilus or feh.

Colors

Changing colors is fairly easy. There are a few color names defined in the colors section (line 12). Just add one of these names before the string containing the text that you want to colorize in the print info section. The default is "orange", and "end" is used to reset the color to the terminal default.

Screenshot

Finally, there is an option to take a screenshot after the script had executed at the very end of the file. It requires scrot. If you want the script to take a screenshot automatically, uncomment the line:
call("scrot")

Also, you can delay the screenshot by tweaking the second parameter of the previous line:
call(["sleep", "x"]) where "x" is the number of seconds to pause before taking the screenshot
. You should leave this at at least "1" (the default), otherwise the screenshot will be taken before the text shows up in the terminal.