SUMMARY Bhen use plasma systemdBoot, some environemt variables defined in `~/.config/environment.d/*.conf`, like `PATH` and `XAUTHORITY`, got overriden after enter plasmashell. But other environment variables, like `EDITOR` and `SSH_AUTH_SOCK`, work as expected. STEPS TO REPRODUCE 1. enable plasma systemdBoot via `kwriteconfig5 --file startkderc --group General --key systemdBoot true` 2. create `~/.config/environment.d/99-env.conf` with content: ``` PATH=${HOME}/.local/bin:${PATH} XAUTHORITY=${XDG_RUNTIME_DIR}/Xauthority ``` 3. logout and re-login, use `htop` to see environment of each process. OBSERVED RESULT plasmashell and other KDE processes doesn't have `~/.local/bin` in their `PATH` environment, but non-KDE user services' processes, such as dbus-daemon do have. And environment `XAUTHORITY` has been set to `~/.Xauthority`, `~/.Xauthority` was generated. EXPECTED RESULT plasmashell and other KDE processes should have `~/.local/bin` in their `PATH` environment, and `XAUTHORITY` should be `/run/user/$UID/Xauthority` SOFTWARE/OS VERSIONS Linux/KDE Plasma: linux 5.11.1-arch1-1 (available in About System) KDE Plasma Version: 5.21.1 KDE Frameworks Version: 5.79.0 Qt Version: 5.15.2 ADDITIONAL INFORMATION
The XAUTHORITY thing is causing Bug 433388.
>2. create `~/.config/environment.d/99-env.conf` with content: XAUTHORITY=${XDG_RUNTIME_DIR}/Xauthority It's a good thing that's overridden, it's set by SDDM on login. PATH I don't know of, but it's not our code directly. We do correctly source a bunch of scripts during login /etc/X11/Xsession.d for example, anything set later overrides something set very early in the boot script. I'm happy to investigate further if you can pinpoint something we're actually doing wrong, but so far I can't see anything
I wonder if there is a method to set `PATH` env for plasmashell process. Since Plasma has adopt systemd to handle service startup stuff, it's environment.d definition should be a reasonable choice. I have several scripts in `~/.local/bin`, and want to invoke them via krunner. And if possible, could you tell me that where are those environment vairables got handled? Is it in sddm, plasma, or both? And in Arch Linux, there is no `/etc/X11/Xsession.d` directory...