.profile & .xprofile
See ../ansible/roles/desktop-environments/tasks/environ.yml.
1. SDDM
See file:///usr/share/sddm/scripts/wayland-session & file:///usr/share/sddm/scripts/Xsession, it uses a login shell for the session.
See https://wiki.archlinux.org/title/Environment_variables#Per_Wayland_session for wayland, it sources file:///home/runner/.config/environment.d.
2. Bash login shell
It loads .bashprofile and stops, even if .profile exists.
3. Systemd user session
It uses configs generated by systemd.environment-generators. For example, file:///usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator loads env set in file:///home/runner/.config/environment.d.
We can provide our own generator in file:///etc/systemd/user-environment-generators/70-login-shell-profile.sh to
source .profile and pass the environment to systemd.
Notice that if the systemd user session is started by the login manager instead of through ssh/console, it would inherit
the environment of the session started by login manager (I don't know the exact reason), which already sourced .profile.