GUI notifications from privileged scripts?

view full story

https://bbs.archlinux.org – I have various scripts which use a facility to trigger a GUI popup notification under certain conditions. Many of these scripts are run with root privileges but I need the popups to appear in a user's X session. I'm trying to migrate these scripts from OS X to Linux but I've run into some problems. I have found various different ways of getting popup notifications and these work fine when I run the command or script myself from the command line but they fail if run as root at the command line or if included in a script running with privileges. (I haven't tried scheduled non (HowTos)