xuserrun – Run a command on the currently-active user’s X.org server display
xuserrun is a bash script to run a command on the active X.org server display. This is primarily necessary if from within another environment (different user, console, cron, boot script…). xuserrun gathers DISPLAY and user environmental variables via systemd and passes them on to be able to dothis. xuserrun is designed for use with only a single user X.org server display. Running it is basic:
xuserrun xclock -digital
Tto put out a notification:
xuserrun notify-send "Hello, Dave."