Re: How to detect a gtk desktop programmatically
- From: Tres Finocchiaro <tres finocchiaro gmail com>
- To: Matthias Clasen <matthias clasen gmail com>
- Cc: desktop-devel-list <desktop-devel-list gnome org>
- Subject: Re: How to detect a gtk desktop programmatically
- Date: Wed, 29 Apr 2020 15:41:07 -0400
Here's a Gnome-project commit making similar assumptions:
As indicated in previous emails, XDG_CURRENT_DESKTOP is less reliable as it relies on string comparison which will ultimately ignore desktops which override this value. The Gnome commit seems to be in agreement of this, so I feel a better technique is warranted. I'm happy to hear arguments to the contrary.
It appears a lot of Debian code still relies on this missing value.
Some have switched to this technique:
os.getenv("XDG_CURRENT_DESKTOP", "").endswith("GNOME")
... however for reasons mentioned earlier, this will fail on XFCE, Pantheon and many others as they set this value, so the C-code which sets it in Gnome3 kindly leaves it alone.
Ubuntu it kind enough to append "ubuntu:GNOME", so the above line works, but this doesn't seem to be a universally adopted standard.
It seems it would be of great service to expose something. I'm not sure I agree that an environment variable is a bad way to do this, it's a variable which describes the environment. It seems just about perfect. ;)
For reference, the commit which introduced this change:
I'll browse the Debian code to see how they've worked around this issue since.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]