Shell-script for setting GTK-theme


Setting a theme for GTK without using GNOME control-panel is often done by copying the gtkrc-file of specified theme to ~/.gtkrc and adding pixmap_path "<the path>" at the beginning of the file. This is a small shell-script making life a bit easier for us.
#/bin/sh

THEME_PATH="`gtk-config --prefix`/share/themes";
if [ $# != 1 ]; then 
        echo "$0 <theme>"
        exit 1;
elif [ ! -d "$THEME_PATH/$1" ]; then
        echo "$THEME_PATH/$1 does not exist"
        exit 1;
fi
(echo "pixmap_path \"$THEME_PATH/$1/gtk\"" && cat $THEME_PATH/$1/gtk/gtkrc) > ~/.gtkrc

Author Per-Olof Pettersson