On newer version of Gnome, we have GNOME_DESKTOP_SESSION_ID=this-is-deprecated. I've been told it's going away in favor of DESKTOP_SESSION, so we should probably check that first before falling back to checking GNOME_DESKTOP_SESSION_ID / KDE_FULL_SESSION. This variable is set by gdm/kdm. The current version of gdm on Ubuntu 8.04/9.04 may set this to "default", which does not help us determine which desktop is currently running. When I filed a bug with gdm, they said it should be fixed in newer version of gdm, and also suggested looking in ~/.dmrc. [1] [1] http://bugzilla.gnome.org/show_bug.cgi?id=589553
This code was added 2009-10-16 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; As suggested by upstream gnome developers, in the downstream bug, https://bugzilla.redhat.com/show_bug.cgi?id=529287 So, we should be good enough here, though DESKTOP_SESSION is tempting. I'd say, let's stick with what we have that works.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.