#!/bin/bash# openbox theme setting script
# autor: crimeboy at hippies.com.br
# date: 06/10/2007
if [ -z $1 ]
then
printf "Usage $0 [options]\ntype $0 -h for more info.\n"
exit 1
fi
if [ -z $2 ]
then
TMENAME=$2
fi
CFGDIR=$HOME/.config/openbox
TMEDIR=/usr/share/themes
lista() {
lsth=$(find $TMEDIR -iname openbox-3 -exec dirname {} \; | cut -f5 -d"/")
printf "$lsth"
}
settheme() {
cat $CFGDIR/rc.xml > $CFGDIR/rc.temp
sed -e "/<theme>/{n;s/\(<name>\).*\(<\/name>\)/\1$1\2/;}" $CFGDIR/rc.temp > rc.xml
if [ $? == "0" ]
then
printf "Theme replaced\n"
else
printf "Failed sed replace\n"fi
}
if [[ $1 == "-l" ]]
then
lista
elif [[ $1 == "-h" ]]
then
printf "$0 -h = display this help\n"
printf "$0 -l = list the themes avaliable\n"
printf "$0 -s <theme name> = set the actual theme\n"
elif [[ $1 == "-s" ]]
then
settheme $2
fi
[ download ]
hey, how abut
$ ln -snf /path/to/theme /home/user/.themes/current
nice tip ;]