understanding the "export DISPLAY=:0" command
#2
The DISPLAY variable is not used by X itself; it is used by X11 applications. It tells X11 applications which screen they should run on. The format of the DISPLAY variable is hostname:display. For local displays, the hostname is often omitted.

The reason this variable is needed is because you can have multiple X servers running locally, or you may wish to use a remote display. So if the DISPLAY variable is not set, your X11 apps have no idea where you want them to run.

If you look at the arguments X is currently running with, you will see which display it is running on. The X server is almost always running on display :0

Code:
root@ike:~# sed 's/\x00/\ /g' /proc/$(pidof X)/cmdline
/usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch -background none

If you have another X server running, like with vncserver or something, then you will see one X server on :0, another on :1, etc.

Hope that helps.


Messages In This Thread
RE: understanding the "export DISPLAY=:0" command - by epixoip - 01-20-2013, 06:27 AM