@kushal You could `su` to a normal user for using dbus to send notifications. There is an example here:
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 :)
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!