10

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.

11

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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