The w command provides a generic way to determine which DISPLAY to use
16:58:06 up 2:13, 5 users, load average: 0.06, 0.04, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
c pts/5 :0.0 16:58 0.00s 0.00s 0.00s w
thence from the FROM column, presumably
export DISPLAY="$( /bin/hostname ):0.0
Will experiment and update.