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.

My script needs to be able to detect if the Unity is being used on top of the Gnome DE. The only other way I can think of is basically seeing if the config file is there.

share|improve this question
add comment

1 Answer 1

up vote 11 down vote accepted

Ubuntu 11.10

  1. Ubuntu session (compiz/unity)

    DESKTOP_SESSION=ubuntu
    GDMSESSION=ubuntu
    XDG_CURRENT_DESKTOP=Unity
    
  2. Ubuntu 2D session (metacity):

    DESKTOP_SESSION=ubuntu-2d
    GDMSESSION=ubuntu-2d
    XDG_CURRENT_DESKTOP=Unity
    
  3. Gnome session (gnome-shell):

    DESKTOP_SESSION=gnome-shell
    GDMSESSION=gnome-shell
    XDG_CURRENT_DESKTOP=GNOME
    
  4. Gnome Classic session (metacity):

    DESKTOP_SESSION=gnome-classic
    GDMSESSION=gnome-classic
    XDG_CURRENT_DESKTOP=GNOME
    
  5. Gnome Classic no effects session (metacity):

    DESKTOP_SESSION=gnome-fallback
    GDMSESSION=gnome-fallback
    XDG_CURRENT_DESKTOP=GNOME
    

Ubuntu 11.04

  1. Ubuntu session (compiz/unity):

    DESKTOP_SESSION=gnome
    GDMSESSION=gnome
    
  2. Ubuntu Classic session (compiz):

    DESKTOP_SESSION=gnome-classic
    GDMSESSION=gnome-classic
    
  3. Ubuntu Classic no effects session (metacity):

    DESKTOP_SESSION=gnome-2d
    GDMSESSION=gnome-2d
    
share|improve this answer
    
When I am running Unity, I seem to have values "gnome" for those variables and XDG_CURRENT_DESKTOP is not found. Using the env command, I find COMPIZ_CONFIG_PROFILE=ubuntu. –  P4L Oct 21 '11 at 17:48
    
@P4L: my answer is based on 11.10, I missed the tag 11.04 in the question :( –  enzotib Oct 21 '11 at 17:51
    
@P4L: I updated my answer –  enzotib Oct 21 '11 at 19:46
add comment

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.