So far in order to investigate I have:
1. installed discord on a lwm desktop via flatpak. This works but is
pretty ugly and the whole filesystem is exposed.
2. Looking into ways to get the XDG_CURRENT_DESKTOP into the systemd
user environment.
Putting a script into the 55 priority in /etc/X11/Xsession.d. This works
(and does not pollute other desktop environments since we can check at
that point). However it depends on the the package dbus-x11 and I have
concerns about the long term support for this package.
Looking at bug #943917, I see these concerns over the dbus-x11 package
and a suggestion that environment.d be used. However this is
unacceptable because that will load the environment variables
irrespective of what desktop environment is chosen. Specifically I have
tested it shows up in "systemctl --user show-environment" but does not
show up in "env" when you login to an openbox desktop.
So the Xsession.d approach seems to be the way to go, but I also have
concerns about how many dependencies (even at the suggests level) should
be added to a package intended to be lightweight. Obviously this could
all be documented.