Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use standardized environment variable for desktop detection #588

Open
deltragon opened this issue Jun 26, 2024 · 4 comments
Open

Use standardized environment variable for desktop detection #588

deltragon opened this issue Jun 26, 2024 · 4 comments
Assignees

Comments

@deltragon
Copy link
Collaborator

deltragon commented Jun 26, 2024

Currently, we (mostly) use DESKTOP_SESSION - however, that seems to be something that only happened to be supported, but never actually standardized. (Eg. sway already doesn't support it, for it we already use XDG_CURRENT_DESKTOP.)
Additionally, this non-standardization leads to issues like #546 - where distros just change DESKTOP_SESSION as they see fit.

There are two options here:

  • XDG_CURRENT_DESKTOP, standardized by the desktop entry spec, allows multiple values
  • XDG_SESSION_DESKTOP, set by systemd, only a single value

It seems slightly preferable to use XDG_CURRENT_DESKTOP, as it is more standard. However, then we need to handle the multi-value case (probably best to just use the first value we recognize).

@deltragon deltragon changed the title Use standard XDG_CURRENT_SESSION for desktop detection Use standardized environment variable for desktop detection Jun 26, 2024
@archisman-panigrahi
Copy link
Collaborator

I am running Kubuntu 24.04 (Plasma 5.27 with Wayland), and echo $XDG_CURRENT_SESSION generates an empty output

@deltragon deltragon self-assigned this Jun 26, 2024
@archisman-panigrahi
Copy link
Collaborator

XDG_CURRENT_DESKTOP is KDE, but XDG_DESKTOP_SESSION is blank.

$ echo $XDG_CURRENT_DESKTOP
KDE
$ echo $XDG_DESKTOP_SESSION

@deltragon
Copy link
Collaborator Author

I typoed it - it's supposed to be XDG_SESSION_DESKTOP

@deltragon
Copy link
Collaborator Author

FTR, on Fedora 41/Plasma 6 Wayland I get:

DESKTOP_SESSION=plasma
XDG_SESSION_DESKTOP=KDE
XDG_CURRENT_DESKTOP=KDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants