10

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).

  • 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

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

  • 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
6

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).

0

For 16.10

Using Startup Applications (as suggested by Matteo) and adapting the startup script from Mr Hyde:

#!/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.interface cursor-theme 'DMZ-White'
  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 'Adwaita'
  gsettings set org.gnome.desktop.interface cursor-theme 'Adwaita'
  gsettings set org.gnome.desktop.wm.preferences theme 'Adwaita'

fi

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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