On 10/01/2024 04:43, Valerio Vanni wrote:
Il 07/01/2024 06:44, Max Nikulin ha scritto:
setpriv --reuid 1000 --regid 1000 --init-groups --reset-env -- \
env XDG_RUNTIME_DIR="/run/user/1000" \
systemd-run --user --slice=app.slice -- \
xterm
setpriv --reuid="$kafuid" --regid="$kafgid" --init-groups --reset-env \
env XDG_RUNTIME_DIR=/run/user/"$kafuid" > $kafdis
XDG_CURRENT_DESKTOP=KDE \
---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Do you really need it? I find it not really safe to use $kafdis without
quotes. The pattern in grep is rather loose one, it may capture several
variables and some of variables may have spaces in their values. On the
other hand the current pattern should capture WAYLAND_DISPLAY.
The point is that kaffeine inherits environment from systemd user
session. I have all necessary variables set in
systemctl --user show-environment
My command works for me without explicit environment tricks.
systemd-run --user --slice=app.slice /usr/bin/kaffeine
--lastchannel > /dev/null 2>&1
P.S. You have explicit modprobe cx23885. Does it mean that this module
is not autoloaded when udev discovers the device?