Topic: Quick Theme switch
I posted about this as a suggestion for Statler so decided to make a very basic version to start with and see if I can develop it into something more useful/universal/user friendly.
unless I've made a boo boo this should quickly switch tint2, conky, wallpaper, gtk and openbox themes.
Requirements are
gtk-theme-switch
Then put the script in a folder that includes:
wallpaper.png
tint2rc
conkyrc
customtheme (a folder containing GTK and openbox themes)
#!/bin/bash
BASEDIR=$(dirname $0)
killall conky
killall tint2
sleep 2s
nitrogen --set-scaled $BASEDIR/wallpaper.png &
tint2 -c $BASEDIR/tint2rc &
conky -c conkyrc &
gtk-theme-switch2 $BASEDIR/customtheme &
rm ~/.themes/customtheme
ln -s $BASEDIR/customtheme ~/.themes/customtheme
perl -i -p -0777 -e 's@<theme>.*?</name>@<theme><name>customtheme</name>@sg' ~/.config/openbox/rc.xml
openbox --reconfigureIt's my first ever attempt at scripting in Linux so it's a bit rough and ready! The perl to replace the openbox rc.xml seems a bit dodgy to me and should probably use something that understands XML to avoid breaking it.
Right now some bits are persistant and some aren't. I've got work to do but I'd like to make it easy to remove and non-destructive to the default conky/tint2 configs and not fill your .themes folder up with every theme you've ever tried so it doesn't actually install anything.
Next up is to get fonts and icons working and then to make it dynamic so you select from a range of themes and it remembers your original settings so there won't be any buyers remorse to trying something new!
Last edited by FonzCam (2010-05-03 16:40:15)