Topic: Setting up two openbox themes with a switch in the menu?

I was theming my crunchbang and just realized I need two themes. I have one that is very bright, and it kills my eyes when I am in a dark room, and I used to have a very dark theme, but I couldn't see it when my laptop is in the sun...

So I need a switch in my menu to change the themerc, gtkrc and nitrogen. How should I do this? I kinda don't know where to start. I don't know what controls the themes apart from the gui... I'm pretty noob with this stuff, really...

EDIT: I just realized I will need to change terminator's colors too...

Last edited by nolla (2010-08-26 20:58:09)

Re: Setting up two openbox themes with a switch in the menu?

Hi there

I don't want to butt in on #! territory, but I am currently developing a distro that does just what you want, it's called ChameleonOS. It comes with a number of pre-set Openbox themes with a switch in the Openbox menu. You also have the option of creating your own theme and saving it as a 'skin'. Details are here:

http://chameleonos.wordpress.com

I think that #! and ChameleonOS have a lot in common, though of course the base is different. Whereas #! is based off Ubuntu/Debian, mine is based off Unity/Mandriva so you have .deb/.rpm bases.

richjack
ChameleonOS developer

Re: Setting up two openbox themes with a switch in the menu?

@richjack - would you mind sharing the script for switching Openbox themes?

Note: ** Please read before posting **

BTW if you wish to contact me, send me an e-mail instead of a PM.

Re: Setting up two openbox themes with a switch in the menu?

idea:
might it be possible to keep two (or more) sets of folders with the specific configuration content for lets say openbox, conky, nitrogen, themerc, gtkrc, terminator ...
they wold coexist in the original places with names like "original_name", "original_name.other".
then you could make a script to switch all these folder names

mv original_name tmp
mv original_name.other original_name
mv tmp original_name.other
# for each of the important folders

and then restart openbox OR X from that script. I think that could do the trick.

But attention this is not tested.
Any expirenced user PLEASE comment/discuss!

luc

Last edited by luc (2010-08-27 07:03:32)

Re: Setting up two openbox themes with a switch in the menu?

here's an older post about the same thing http://crunchbanglinux.org/forums/topic … ybindings/

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

Re: Setting up two openbox themes with a switch in the menu?

@luc - That might be possible except I don't think you can put all the configs in one folder.

For Openbox you could use something like:

cd ~/.config/openbox/
mv rc.xml tmp
mv rc.xml.other rc.xml
mv tmp rc.xml.other
openbox --reconfigure
Note: ** Please read before posting **

BTW if you wish to contact me, send me an e-mail instead of a PM.

Re: Setting up two openbox themes with a switch in the menu?

anonymous wrote:

@luc - That might be possible except I don't think you can put all the configs in one folder.

I think so too. my idea was rather to take each config folder of interest (like ~/.config/openbox) and keep a duplicate of that. that would make it possible to keep a whole different set of OB config (also menu) so the snippet could look like this:

mv ~/.config/openbox ~/.config/openbox.tmp
mv ~/.config/openbox.other ~/.config/openbox
mv ~/.config/openbox.tmp ~/.config/openbox.other
openbox --reconfigure

I have seen that iggykoopa ^^ provided a link but there the people also only copy single files.
maybe i have to test this idea with folders to provide some data on this ...
luc

Re: Setting up two openbox themes with a switch in the menu?

Hey, thanks everyone. Here's what I did.

I created a themeswitch folder and made two scripts, one for each theme, then I placed them in the menu. This way I can make a bunch of themes and not just two. The script looks like this now.

    
cp -fr /home/ville/.themes/oma_black/oma /home/ville/.themes/
cp -fr /home/ville/.moc/themes/black/oma /home/ville/.moc/themes
cp -fr /home/ville/.config/terminator/black/config /home/ville/.config/terminator/
nitrogen --set-centered /home/ville/images/wallpapers/oma_black.png
openbox --reconfigure  
exit

So, I am basically just copying the themes, it somehow seems more logical for my mind than the renaming. I had a little trouble with the nitrogen, as it doesn't seem to remember what theme I had, so I added this to my autostart.sh:

/home/ville/.themeswitch/white &

...and disabled the previous nitrogen entry there. I thought about making several autostarts so that it would remember which theme I had, but I thought that there's too much hassle if I want to edit autostart later for whichever reason, since I would have to copy/paste the changes to each of my autostarts...

Come to think of it, I could make a script that stays the same for the autostart, though... hmm... maybe I'll do that...

So, what do you guys think? Is this ok, do you see any flaws with this way?

Oh, one thing, I need one more thing to make this work perfectly. When I change the theme, it doesn't update it on any window (pcman, moc, firefox etc). On the thread linked by Iggy they just restarted thunar. Well, first of all, I don't know how to do the same with pcmanfm, and even if I did, it still wouldn't work on firefox or moc or any others... and, even if that worked, it still wouldn't be perfect since it closes the windows instead of changing the themes.

So, what I need is a similar command to the one that the Interface Settings GUI is using to update all the windows with the theme.

Re: Setting up two openbox themes with a switch in the menu?

I don't think theres any command for that other than restarting the applications.

Note: ** Please read before posting **

BTW if you wish to contact me, send me an e-mail instead of a PM.

Re: Setting up two openbox themes with a switch in the menu?

But the GUI editor gets to do it.. There has to be a way...

Re: Setting up two openbox themes with a switch in the menu?

Changing the GTK theme is done by editing the ~/.gtkrc-2.0 file if thats what you are asking.

Note: ** Please read before posting **

BTW if you wish to contact me, send me an e-mail instead of a PM.

Re: Setting up two openbox themes with a switch in the menu?

anonymous wrote:

@richjack - would you mind sharing the script for switching Openbox themes?

Well I am still working on some refinements for the next release then I think I'll make it a separate project - right now it's pretty specific to the ChameleonOS setup, but I'd like to make a more generic version. It's basically just a collection of bash commands to move and copy config files into the home directory.

Re: Setting up two openbox themes with a switch in the menu?

anonymous wrote:

Changing the GTK theme is done by editing the ~/.gtkrc-2.0 file if thats what you are asking.

...and when you click "Apply" in lxappearance, changes to ~/.gtkrc-2.0 are saved and the X11 session is reconfigured.  Is there a way to pass this from the command line?

while ( ! ( succeed = try() ) );

Re: Setting up two openbox themes with a switch in the menu?

I haven't tested this but you try using gtk-theme-switch to change gtk themes:

http://www.khussein.com/change-gtk-them … mand-line/

Note: ** Please read before posting **

BTW if you wish to contact me, send me an e-mail instead of a PM.

Re: Setting up two openbox themes with a switch in the menu?

not sure if it is too late, i just set up 2 keybindings to switch from a dark to a bright theme,
nothing really fancy, but it works fine,

keybinding launches the following scripts:

#!/bin/sh
gtk-theme-switch2 /usr/share/themes/Orangine
cp -f /home/koalinki/.config/openbox/rc.xml-fifi /home/koalinki/.config/openbox/rc.xml
cp -f /home/koalinki/.gtkrc-2.0.mine-fifi /home/koalinki/.gtkrc-2.0.mine
openbox --restart
#!/bin/sh
gtk-theme-switch2 /home/koalinki/.themes/Clearlooks-DarkOrange
cp -f /home/koalinki/.config/openbox/rc.xml-michi /home/koalinki/.config/openbox/rc.xml
cp -f /home/koalinki/.gtkrc-2.0.mine-michi /home/koalinki/.gtkrc-2.0.mine
openbox --restart

the gtk-theme-swithc2 loads the gtks theme
the rc.xml-fifi has a bright openbox theme and a specific set of keybindins
the rc.xml-michi has a dark openbox theme
.gtkrc-2.0.mine-michi/fifi contain the icon theme

gtk-icon-theme-name = "Tangerine"

hope this helps

Re: Setting up two openbox themes with a switch in the menu?

Why do you restart Openbox? For just changing Openbox themes or settings, a reconfigure is enough.

Note: ** Please read before posting **

BTW if you wish to contact me, send me an e-mail instead of a PM.

Re: Setting up two openbox themes with a switch in the menu?

thanks you are right, tried with reconfigue and it works


noticed that not always icons set got changed, so i shuffled things a bit around, solution was to have the replacing of .gtkrc.mine as first thing...

thanks

M

Re: Setting up two openbox themes with a switch in the menu?

mcarni wrote:

not sure if it is too late, i just set up 2 keybindings to switch from a dark to a bright theme,
nothing really fancy, but it works fine,

Been a long time! smile I'm not even running #! anymore, since I fried my hard drive and had to get something lighter... But, my Arch is very much a crunchbang clone, ha!

Yeah, rambling. I did almost exactly like you. It's working nicely, looks good. I have tint2 there as well. Have to point out one thing if anyone is trying to do the same. You can't just copy tint2rc and restart OB. It won't work. But, it wasn't hard to fix:

cp -f ~/scripts/tintrc_d ~/.config/tint2/tint2rc
tint2