I think a reliable way of determining whether the current session is Unity 2D is to check the value of the GDMSESSION environment variable.
For unity, its value is "gnome".
For unity-2d, its value is "unity-2d".
For Ubuntu classic, its value is "gnome-classic".
I think a reliable way of determining whether the current session is Unity 2D is to check the value of the GDMSESSION environment variable.
For unity, its value is "gnome".
For unity-2d, its value is "unity-2d".
For Ubuntu classic, its value is "gnome-classic".