To send desktop notification from a background script running as root
(replace X_user and X_userid with the user and userid running X respectively):
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.'
Taken from https://wiki.archlinux.org/index.php/Desktop_notifications