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 --reconfigure

It'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)

Re: Quick Theme switch

With a few tweaks and a few of gutterslob's themes as examples I've made something that kind of works!
http://www.fonz.co.uk/themeswitch-0.22.tar.gz

Extract it somewhere like your home folder and then click on the themeswitch.sh in either of the two theme folders to switch over to that theme/config  There's another script called remove.sh that should undo everything.

I've only tested it on the openbox statler live cd and there are still plenty of issues but it gets the job done. 

(you still need gtk-theme-switch installed for the gtk bit to work.  You may also need to create the ~/.themes folder)

changes from the previous script are that it now modifies autostart.sh, a few files have moved around and the remove.sh script returns to the system to default.

In simple terms it creates a symbolic link from ~/.themes/customtheme to the selected theme and re-launches everything pointing to that location for config and theme files.

Re: Quick Theme switch

Sounds like your making progress, I'll try it out tomorrow if I get a chance.

just call me...
~FSM~

Re: Quick Theme switch

you could try improving the theme switcher I made here http://crunchbanglinux.org/forums/topic … installer/ .I haven't worked on it in a while, but it already supports icons, openbox themes, wallpapers, etc

I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.

Re: Quick Theme switch

Hi, sorry for the up (last post was on 2010), but I've did a modification, I think easier and more complete.

I'm too tired to translate (it is 5:47 AM in Paris), but you can see and download it here:
http://crunchbanglinux-fr.org/forum/vie … 198#p11198

If somebody wants a quick translation, I will ^^

Thanks iggykoopa and FonzCam for the base.

I hope that some people will like it.

From Paris with love big_smile

DW

Re: Quick Theme switch

The link is dead for the download from darthwound.

Re: Quick Theme switch

Yes, sorry.

You can modify the CTKarch script in order to have the same result.