Detecting Gnome in C without GNOME_DESKTOP_SESSION_ID?

150 views Asked by At

I'm trying to detect the user's desktop environment (Gnome, KDE, etc) in C.

Currently, I'm doing something like this:

if (getenv("GNOME_DESKTOP_SESSION_ID"))
{
   // if getenv didn't return NULL, GNOME_DESKTOP_SESSION_ID must be defined
}

However, on my system, GNOME_DESKTOP_SESSION_ID is defined to be "this-is-deprecated".

Is there another environment variable (or entirely different way) I could check for the presence of Gnome?

0

There are 0 answers