Support the XDG Base Directory Specification
I think that sddm should support the XDG Base Directory Specification. In particular, the default Xsession script should also source configuration files from ${XDG_CONFIG_HOME} in addition to the home directory.
I propose adding the following to the default Xsession script:
XDGXSESSION=${XDG_CONFIG_HOME:-$HOME/.config}/xsession
if [ -f "$XDGXSESSION" ]; then
. "$XDGXSESSION"
fi
What is the benefit of sourcing files from that dir, when you are starting sddm x11 in root or rootless mode ? Feel free to prepare PR.
I am not sure, what do you mean by "root or rootless mode", I was under the impression, that the Xsession script is ran as the "current" user, that is attempting to log in. Am I mistaken?
The benefit of following the XDG Base Directory specification is that it helps people declutter their home directories and better organize their config files.
I use pam_env to set up my environment variables, so my XDG_CONFIG_HOME is already set immediately after starting a login shell. I checked, and the environment variables are already set when the sddm/scripts/Xsession script is ran. Alternatively, you don't even need to set any environment variables if your XDG_CONFIG_HOME is the default ~/.config folder.
I'm a bit busy right now, so I don't have the time to make a PR right now, but I am willing to do it once I have some free time.
See also: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1651
And #1543