1

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

  • 4
    Then your service needs to first determine which user's desktop it's interested in. If the system is running Xvnc, there may be any number of GUI users simultaneously, each possibly using a different desktop environment. Or there may be no desktop environment installed at all; this is common on rack-mounted server systems. – telcoM Jun 5 '19 at 5:57
  • 1
    Possibly a XY problem. Why do you need to know the desktop environment? There are desktop-agnostic ways to communicate with the user D-BUS... – xenoid Jun 5 '19 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.