The magic word is
DISPLAY. In the X window system, a display consists
(simplified) of a keyboard, a mouse and a screen. A display is managed
by a server program, known as an X server. The server serves displaying
capabilities to other programs that connect to it.
A display is indicated with a name, for instance:
The display consists of a hostname (such as
localhost), a colon (
:), and a sequence number (such as
4). The hostname of the display is the name of the computer
where the X server runs. An omitted hostname means the local host. The
sequence number is usually 0 -- it can be varied if there are multiple
displays connected to one computer.
If you ever come across a display indication with an extra
attached to it, that's the screen number. A display can actually have
multiple screens. Usually there's only one screen though, with number
n=0, so that's the default.
Other forms of
DISPLAY exist, but the above will do for our purposes.
For the technically curious:
hostname; the X server for this display is listening at TCP port
host; the X server for this display is listening at UNIX domain socket
/tmp/.X11-unix/XD(so it's only reachable from
:D.Sis equivalent to
hostis the local hostname.