On 16/07/2024 10:39, Greg Wooledge wrote:
hobbit:~$ cat .config/systemd/user/service.d/env.conf
[Service]
Environment="FOO=%h/test123" "BAR=b a r"
hobbit:~$ systemctl --user daemon-reload
hobbit:~$ systemctl --user start xterm.service

daemon-reload is not enough in KDE. krunner and plasmashell services have been started already, so changes would not apply despite they are visible in "systemctl --user show-environment". Perhaps launchers just do not listen for a proper D-Bus signal emitted by systemd user daemon.
The same applies for environment.d.

So logout is necessary.

I have unsuccessfully tried to find a way to apply environment.d without logout. I do not see anything relevant in KDE system settings. <https://userbase.kde.org/Session_Environment_Variables> suggests $HOME/.config/plasma-workspace/env/path.sh that are autostart scripts, so runtime changes are not applied.

SSH login may cause starting of some systemd user services:

    948 pts/0    Ss     0:00  \_ -bash
   1017 pts/0    R+     0:00      \_ ps xwf
    921 ?        Ss     0:00 /lib/systemd/systemd --user
    927 ?        S      0:00  \_ (sd-pam)
942 ? Ssl 0:00 \_ /usr/bin/pulseaudio --daemonize=no --log-target=journal 984 ? Ss 0:00 \_ /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only

An additional consideration concerning applications started through D-Bus: I think, they are started through systemd nowadays. At first I forgot that enough .desktop files prescribe starting through D-Bus ignoring Exec= field.

/usr/share/applications/org.kde.kwrite.desktop:X-DBUS-StartupType=Multi
/usr/share/applications/org.kde.kwrite.desktop:X-DBUS-ServiceName=org.kde.kwrite


Reply via email to