Environement variable in /etc/profile.d or ~/.bash_profile is not applied for non-GNOME wayland session
Similar to https://bugzilla.gnome.org/show_bug.cgi?id=736660, but for session launched by gdm.
E.g. Some distribution, like Archlinux still use /etc/profile.d to set lots of important environment variables, e.g. Java, flatpak.sh. Other DM, e.g. SDDM, would also use login shell to apply such profiles. https://github.com/sddm/sddm/blob/develop/data/scripts/wayland-session
Before the topic falls to why not just using ~/.config/environment.d, I'd like to point out that some down side of using environment.d
- environment.d only loads once with systemd --user. It means new modification to environment.d will not be automatically picked up upon user log out. User will need to either restart systemd user session (which is not done automatically today upon log out), or manually run daemon-reload systemd (daemon-reload will make it lost all the imported value, which may not be what user want), or reboot.
- environment.d is intended for user unit, while people are trying to move to it, it kinda like abuse its original design. (man environment.d says "Definition of user service environment"). And till today, it's not supported globally by all DMs.
- environment.d is static and lacking some flexibility of make adjustment at runtime.
Since gdm supports login shell based environment variables via Xsession since long time ago, I'd hope gdm can keep support the exact same thing for the wayland session.
Edited by Weng Xuetian