Closed markstos closed 2 years ago
That's something usually set by a DM - GDM, LightDM or SDDM (but not greetd or ly). Here's the list of variables for desktop detection that I'm aware of:
DESKTOP_SESSION
non-standard, set by a DM to the name of a session file sans extension - sway
GDMSESSION
- non-standard, same value as above, appears to be set by all the DMs that support DESKTOP_SESSION
XDG_SESSION_DESKTOP
- documented in systemd, different DMs will use different values, but none will follow the spec and give you what you expectXDG_CURRENT_DESKTOP
- part of a Freedesktop specification, recommended for use to detect a desktop session type, all DMs agree to read the value from DesktopNames
key in the session file (which is intentionally omitted from sway.desktop and results in an empty variable)Apparently, DESKTOP_SESSION
is also supposed to be obsoleted by the XDG_SESSION_DESKTOP
, but in a wonderful mess of undocumented XDG-but-not-really variables I can't even find a reliable source for that :weary:
I think I'll add a conditional pass through (only if set) for DESKTOP_SESSION
as the working one and XDG_SESSION_DESKTOP
as the standard one. But I really hope that nothing important relies on these variables.
Edit: Both systemd import-environment
and dbus-update-activation-environment
are ignoring unset variables, so was safe to add the vars into the VARIABLES
list without any checks.
I've researched the DESKTOP_SESSION variable some but am not sure who usually sets. It shows up in recipes like this for starting gnome-keyring-daemon:
I think forSway, I think
DESKTOP_SESSION
is usually set tosway
. Shouldsway-systemd
set DESKTO_SESSION or pass it through?