Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I sometimes use two different Desktop Environments like Unity and Gnome Shell (comparing, testing, creating screenshots, etc.) but Unity looks bad using Adwaita theme, which is the same with Gnome Shell and Ambiance theme. Changing every time is quite a hassle and sometimes (but now less frequent than before) it crashes (I'm using Oneiric).

share|improve this question
    
Both sessions are using the same theme because you're using your user to log in, selecting a new user will do it for you. –  Uri Herrera Oct 3 '11 at 0:59

2 Answers 2

up vote 2 down vote accepted

You can try creating a script which you set to execute at each starts where you recognize which DE you are using and switch the theme in base of what you are running

share|improve this answer
    
Is it possible to change the themes from a script? I can use XDG_CURRENT_DESKTOP to know the DE, but I don't know how does Gnome 3 save theme settings. –  Arnel A. Borja Oct 3 '11 at 16:33
    
Ah, found it, I should use gsettings. Thanks! –  Arnel A. Borja Oct 3 '11 at 16:46

Building upon the previous answers:

For 11.10

#!/bin/bash

if [ "$XDG_CURRENT_DESKTOP" = "Unity" ]
then
  gsettings set org.gnome.desktop.interface gtk-theme 'Ambiance'
  gconftool-2 --set --type string /apps/metacity/general/theme 'Ambiance'
  gsettings set org.gnome.desktop.interface icon-theme 'Faenza-Ambiance'

else
  gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'
  gconftool-2 --set --type string /apps/metacity/general/theme 'Adwaita'
  gsettings set org.gnome.desktop.interface icon-theme 'Faenza'

fi

For 12.04 and 12.10

#!/bin/bash

if [ "$XDG_CURRENT_DESKTOP" = "Unity" ]
then
  gsettings set org.gnome.desktop.interface gtk-theme 'Ambiance'
  gsettings set org.gnome.desktop.interface icon-theme 'ubuntu-mono-dark'
  gsettings set org.gnome.desktop.wm.preferences theme 'Ambiance'

else 
  gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'
  gsettings set org.gnome.desktop.interface icon-theme 'gnome'
  gsettings set org.gnome.desktop.wm.preferences theme 'Adwaita'

fi

Add this script to Startup Applications (Add => Command sh path/to/script).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.