#!/bin/sh

if [ "x${1}" = "x" ]; then
    echo "Usage: Camaelon [THEME|Off]"
    echo
    echo "Available themes:"
    ls -1d /usr/lib/GNUstep/System/Library/Themes/*.theme | sed "s,.*/,,"
    echo
    exit
fi

. /usr/lib/GNUstep/System/Library/Makefiles/GNUstep.sh
if [ "${1}f" = "Off" ]; then
    defaults delete NSGlobalDomain GSAppKitUserBundles
else
    defaults write NSGlobalDomain GSAppKitUserBundles '("/usr/lib/GNUstep/System/Library/Bundles/Camaelon.themeEngine")'
    defaults write Camaelon Theme ${1}
fi
