I am working on code so a BOINC client can detect the desktop environment used by the user (mainly GNOME, KDE Plasma, XFCE, LXDE/LXQT). This feature will be needed for various reason that are off topic.
One idea is to use GDBus to scan DBus to detect the running d.e.
Another suggestion I received is to use the
XDG_SESSION_DESKTOP enviroment variable. The problem of this solution is that boinc-client runs as a service
with its own user, therefore it will not be able to read
XDG_SESSION_DESKTOP defined in other users sessions.
I am actually wondering if checking for specific executables like for example /usr/bin/plasmashell or scanning running processes would be the best idea