This is a technical document detailing exactly how Lubuntu does XDG settings, some problems we have faced, and anything else worth mentioning.
How we get our settings
Here's a step-by-step on what pulls from what:
- SDDM pulls the session name from
/usr/share/xsessionswhen logging in. In our case, it'sLubuntu.desktop. Therefore, theDESKTOP_SESSIONenvironment variable is set toLubuntu, from this filename. Please note that we had to patch SDDM to do this properly; it used to makeDESKTOP_SESSIONan absolute path, which, when we continue in these steps, breaks things. TODO: send this upstream. - xorg sets the
XDG_CONFIG_DIRSenvironment variable to/etc/xdg/xdg-DESKTOP_SESSIONand/etc/xdgandXDG_DATA_DIRSto/usr/share/DESKTOP-SESSIONandusr/shareat minimum. NOTE: this is an Ubuntu-specific patch in xorg. startlxqtthen grabs the values ofXDG_CONFIG_DIRSandXDG_DATA_DIRSto use in the call tostartlxqt, which then does a one-time copy of the settings from the first entry in both.
Problems we have faced and things to not touch
Black screen in Lubuntu Next 18.04 on starting the live session
For a while before we could figure it out, the Lubuntu Next 18.04 image had a black screen on the live CD and on bootup of a new Lubuntu Next system. The LXQt system had been logged in, but nothing was visible. This is why we had to patch SDDM, because the value of XDG_CONFIG_DIRS didn't have our valid XDG path; it was an absolute path put onto /etc/xdg/xdg-. So therefore, if the situation ever comes up again, it means that XDG_CONFIG_DIRS can't find valid settings. This also caused Simon to confront upstream; they had moved the default settings to /usr/share from /etc/xdg because they believed that it would apparently make it easier for distributors. Not only did they not consider that /usr/share is not in the XDG spec, they did no verification in LXQt itself to ensure that /usr/share at minimum is always there. When Simon submitted a patch, it was rejected on the grounds that it was too distro-specific, which was ironic because they didn't follow the XDG spec. Alf has since reconsidered and asked Simon to resubmit the patch.
Be careful when changing the session .desktop file name
If you rename /usr/share/xsessions/Lubuntu.desktop to something else, please do change /etc/xdg/xdg-Lubuntu/ to the same name. Otherwise none of our settings will be applied.