[NCLUG] Display variables

Michael Dwyer mdwyer at sixthdimension.com
Mon Dec 18 10:03:26 MST 2000


At 01:08 PM 12/17/00 -0700, you wrote:

> > So my question is, How do I "reset"
> > the DISPLAY variable?
>
>What Mark said. $DISPLAY is set to "hostname:#.#" where,
>
>- hostname is the host to display on
>- the first # is the instance of X to display on(some systems have mulitple
>video cards and input devices so multiple people can use them at the same 
>time)
>- the second # is the screen of that instance of X for people with 
>multiheaded
>setups.
>
>Most of the time you'll only need "export DISPLAY=:0".

Nobody asked, but here's a little hint to speed up your computing:
If you set your display like one of these:

DISPLAY=gamebox:0.0
DISPLAY=localhost:0.0

Then the X library must make a TCP connection to the X server.  This takes 
time, even if it is going thought the loopback port.  (Anyone ever ran 
pathchar on 127.0.0.1?)
However, if you skip the hostname part entirely, as was shown above:

DISPLAY=:0.0
DISPLAY=:0

then the library connects using a local UNIX socket (normally 
/tmp/.X11-unix/Xn, where 'n' is the display number).  This has less 
protocol overhead, and so it a bit faster.
Get used to the shortest form.  It is easier to type anyway. :)






More information about the NCLUG mailing list