On 02/03/26 at 16:18, Teemu Likonen wrote:
Not that one (before) but those notification daemons tend to require the
same user. So does "fyi":

     $ sudo fyi Title Message
     error: failed to connect: /usr/bin/dbus-launch terminated abnormally
     without any error message

So root can't easily send notifications for other users.

Yes, but if you want to ditch "wall" then you could try to play with this code in your script:

uid=1000 gid=1000
setpriv --reuid "$uid" --regid "$gid" --init-groups \
env XDG_RUNTIME_DIR=/run/user/"$uid" DISPLAY=:0 XDG_CURRENT_DESKTOP=KDE fyi TEST test

Of course you have to change 1000 if your user id is different, the "id" command will tell you which value of uid and gid to use. Also the DISPLAY value matters. Here it works, but I'm on KDE+X11, not Wayland sorry.

Unlike the "wall" command, you will have to write a "setpriv" command for each user you want to notify if something goes wrong in the script.

Kind regards.
--
Franco Martelli

Reply via email to