Send a notification from a template

Hi,

I’m trying to improve the flatpak integration, I would like to upgrade all flatpaks installed except if there is a permission change requiring a user validation.

I need to tell the user that they should do something, sending a popup or any kind of message to indicate something is wrong should be enough, however notify-send does not work as root in a template, and I’m not sure there is a way to show a popup from a systemd service or /rw/config/rc.local

An idea would be to have an RPC call to show a popup…?

sudo -u user notify-send MESSAGE does not work?

bash-5.2# sudo -u user notify-send test test
Failed to execute child process “dbus-launch” (No such file or directory)

You probably need a notification daemon/service.
For my debian 12 minimal template I use notification-daemon.

What happens if you specify the bus path like this?

sudo -u user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send test test