На
http://askubuntu.com/questions/72549/how-to-determine-which-window-manager-is-runningOn Ubuntu 12.04 I tested environment variables XDG_CURRENT_DESKTOP and GDMSESSION and got the following results:
KDE
XDG_CURRENT_DESKTOP=
GDMSESSION=kde-plasma
Unity 3d
XDG_CURRENT_DESKTOP=Unity
GDMSESSION=ubuntu
Unity 2d
XDG_CURRENT_DESKTOP=Unity
GDMSESSION=ubuntu-2d
Gnome
XDG_CURRENT_DESKTOP=GNOME
GDMSESSION=gnome-shell
Gnome Classic
XDG_CURRENT_DESKTOP=GNOME
GDMSESSION=gnome-classic
Gnome Classic no effects
XDG_CURRENT_DESKTOP=GNOME
GDMSESSION=gnome-fallback
Ubuntu 14.04:
Unity running with Mir
XDG_CURRENT_DESKTOP=Unity
GDMSESSION=ubuntu
*Note MIR_SERVER_NAME is also set*
MIR_SERVER_NAME=session-$NUMBER
Other Ubuntu based distributions:
Mint 13 (Cinnamon)
XDG_CURRENT_DESKTOP=GNOME
GDMSESSION=cinnamon
Lubuntu 12.04
XDG_CURRENT_DESKTOP=LXDE
GDMSESSION=Lubuntu