Monday, January 7, 2008

How to setup DISPLAY in profile file?

While setting up display to local machine, one can use following method to set it in /etc/profile file so that each time, display can be set automatically. This solution works very well for Solaris 10 and any other Solaris version.

ME=`who -m PIPE awk '{print $2}'`
PORT=`who -u | grep $ME | awk '{print $8}' | sed 's/(//' | sed 's/)//'`
export DISPLAY

Q: How to check if DISPLAY variable is setup correctly?
Ans. The easiest way to test to check if DISPLAY is set correctly is to run /usr/openwin/bin/xclock command. If it shows a GUI clock, then your display variable is set correct.

No comments: