Closed ohazi closed 4 years ago
Apparently I just don't know how to use systemd.
You can create a file like this:
ohazi@apricot:~$ cat .config/environment.d/10-path.conf
PATH=~/.local/bin:$PATH
ohazi@apricot:~$
or you can run one of the set-environment / import-environment commands in a startup script (see: https://wiki.archlinux.org/index.php/Systemd/User#How_it_works).
And then it should work as expected:
ohazi@apricot:~$ systemctl --user show-environment
HOME=/home/ohazi
LANG=en_US.UTF-8
LOGNAME=ohazi
MAIL=/var/spool/mail/ohazi
PATH=~/.local/bin:/usr/local/bin:/usr/bin
SHELL=/bin/bash
USER=ohazi
XDG_RUNTIME_DIR=/run/user/1000
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
ohazi@apricot:~$ systemctl --user status clipmenud.service
● clipmenud.service - Clipmenu daemon
Loaded: loaded (/usr/lib/systemd/user/clipmenud.service; enabled; vendor preset: enabl>
Active: active (running) since Fri 2020-01-03 23:16:05 PST; 2s ago
Main PID: 6842 (bash)
CGroup: /user.slice/user-1000.slice/user@1000.service/clipmenud.service
├─6842 bash /usr/bin/clipmenud
└─6844 clipnotify
Jan 03 23:16:05 apricot systemd[1205]: clipmenud.service: Succeeded.
Jan 03 23:16:05 apricot systemd[1205]: Stopped Clipmenu daemon.
Jan 03 23:16:05 apricot systemd[1205]: Started Clipmenu daemon.
ohazi@apricot:~$ which clipnotify
/home/ohazi/.local/bin/clipnotify
ohazi@apricot:~$
I have clipnotify installed in ~/.local/bin, which is in my user's $PATH
When launching clipmenud manually, it finds clipnotify and doesn't report the warning:
When launching it via the systemd service, I do see the warning:
This appears to be expected behavior: https://www.freedesktop.org/software/systemd/man/systemd.exec.html#%24PATH
It may not be worth finding a workaround for this... I couldn't come up with anything obvious that wasn't a big hack, so I just installed clipnotify globally. Feel free to close this issue -- at least closed bug reports are searchable, in case anyone else comes across the same issue.