Originally posted by Greg Eriksen
# Set the DISPLAY variable# Note: this assumes you are connected from a graphics display. Any application# that uses this variable may fail if you are not running X.. /usr/local/bin/set.display
export DISPLAY=`who -m | awk ' { print $6 }' | cut -f 2 -d'(' | cut -f 1 -d')'`:0.0