Is there an environment variable that is set for Unity?
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.
Solution 1:
Ubuntu 11.10
-
Ubuntu session (compiz/unity)
DESKTOP_SESSION=ubuntu GDMSESSION=ubuntu XDG_CURRENT_DESKTOP=Unity
-
Ubuntu 2D session (metacity):
DESKTOP_SESSION=ubuntu-2d GDMSESSION=ubuntu-2d XDG_CURRENT_DESKTOP=Unity
-
Gnome session (gnome-shell):
DESKTOP_SESSION=gnome-shell GDMSESSION=gnome-shell XDG_CURRENT_DESKTOP=GNOME
-
Gnome Classic session (metacity):
DESKTOP_SESSION=gnome-classic GDMSESSION=gnome-classic XDG_CURRENT_DESKTOP=GNOME
-
Gnome Classic no effects session (metacity):
DESKTOP_SESSION=gnome-fallback GDMSESSION=gnome-fallback XDG_CURRENT_DESKTOP=GNOME
Ubuntu 11.04
-
Ubuntu session (compiz/unity):
DESKTOP_SESSION=gnome GDMSESSION=gnome
-
Ubuntu Classic session (compiz):
DESKTOP_SESSION=gnome-classic GDMSESSION=gnome-classic
-
Ubuntu Classic no effects session (metacity):
DESKTOP_SESSION=gnome-2d GDMSESSION=gnome-2d