.profile & .xprofile

See ../ansible/roles/desktop-environments/tasks/environ.yml.

1. SDDM

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.


Updated: 2025-12-04 Thu 02:42