tinydm-run-session: Set and export XDG_SESSION_DESKTOP and XDG_CURRENT_DESKTOP
XDG_SESSION_DESKTOP is a desktop identifier which is expected
to be set by the display manager and handed to the logind[1].
The logic to set the name is extracted from gdm and matches
the environment variable set in phosh.service[2] when being
started without a display manager. Right now, at least in phosh, this variable is not being set at all. One random consequence is that evince
and epiphany
are not hiding certain panels that they should be hiding: https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2571
XDG_CURRENT_DESKTOP is currently being set by other display
managers by using the DesktopNames entry in the session file.
Unfortunately, this step is not clearly documented[3][4][5],
but seems to be the way other display managers are setting
the variable. In GNOME/Phosh, GNOME session sets this variable to GNOME
if missing, which might be a reason why it got unnoticed. However, current value in phosh is GNOME:Phosh
[2].
I have tested this in Phosh and it seems to work well, but more testing is always welcomed. However, to make the functionality of XDG_CURRENT_DESKTOP
work without changes, Alpine's phosh.desktop
needs to update X-DesktopNames
to DesktopNames
. I could send the MR, but I thought it would make more sense to first have the discussion here.
@dylanvanassche, you seem to have been involved in phosh change from GNOME
to GNOME:Phosh
, so I thought that you would want to look into this one.
[1] https://www.freedesktop.org/software/systemd/man/pam_systemd.html
[2] https://gitlab.gnome.org/World/Phosh/phosh/-/blob/main/data/phosh.service#L35
[3] https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html