1752565 Members
5721 Online
108788 Solutions
New Discussion юеВ

Lost DISPLAY variable

 
Bettina Ofner
Advisor

Lost DISPLAY variable

My maschine lost it`'s DISPLAY variable.
echo $DISPLAY gives no output.
How can I set the DISPLAY variable permantent ?
Thanks
Bettina
2 REPLIES 2
Marc Dijkstra
Trusted Contributor

Re: Lost DISPLAY variable

You must check your .profile (or whichever shell login you are using or /etc/PROFILE and check that the DISPLAY is set up.

Make sure that uname -a knows the hostname, as you need to run:
# export DISPLAY=`hostname`:0.0

If the hostname is unknown or mixed up, it will mess up the DISPLAY variable..

MND
"A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila"
Bill Hassell
Honored Contributor

Re: Lost DISPLAY variable

There is nothing magic about $DISPLAY. It needs to be set each time you do a 'normal' login. Here's a script snippet you can include in your .profile that wil always set it automatically:

export DISPLAY="$(/usr/bin/who -muR | /usr/bin/awk '{print $NF}'):0.0"

This will as long as you are adjacent and not logged through 2 or more additional systems.



Bill Hassell, sysadmin