A #Linux #desktop application running as root, what is the best way for it to send notifications to the normal logged in user?

@abhas my code is running as root and i can not figure out how to talk to session dbus from there to show the notification

Follow

@kushal You could `su` to a normal user for using dbus to send notifications. There is an example here:

wiki.archlinux.org/index.php/D

sudo -u X_user DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/X_userid/bus notify-send 'Hello world!' 'This is an example notification.'

@abhas yes this exactly what I am using now , but I was hopping to do from code properly :)

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!