Re: Writing C/C++ code to detect running desktop environment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 29, 2019 at 1:16 PM Kalev Lember <kalevlember@xxxxxxxxx> wrote:
>
> On Wed, May 29, 2019 at 7:11 PM Germano Massullo <germano.massullo@xxxxxxxxx> wrote:
>>
>> I am working on implementing a piece of code that allows BOINC client
>> [1] to 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.
>> What do you think about?
>> Thank you
>
>
> I would suggest reading the XDG_CURRENT_DESKTOP env variable. AFAIK all major desktops support it and set it correctly for their sessions.
>

I realize you said that the reasons are off-topic, but in general I'd
recommend not making desktop-specific decisions at a high-level and
instead base your decisions off of availability of particular
functionality. For example, if your application needs to manage
software updates, have it check for whether PackageKit or dnf-daemon
are available. If it needs to store something in a password wallet,
check for GNOME Keyring or KWallet, etc.

Among other things, it means that alternative desktops that share some
tools with the popular ones don't have to get special code to work
with your project.
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux