alebastr / sway-systemd

Systemd integration for Sway session
MIT License
131 stars 11 forks source link

set or pass through DESKTOP_SESSION? #16

Closed markstos closed 2 years ago

markstos commented 2 years ago

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:

if [ -n "$DESKTOP_SESSION" ];then
    eval $(gnome-keyring-daemon --start)
    export SSH_AUTH_SOCK
fi

I think forSway, I think DESKTOP_SESSION is usually set to sway. Should sway-systemd set DESKTO_SESSION or pass it through?

alebastr commented 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:

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.