[TAGS]
The format of the display variable is
[host]:<display>[.screen].
host refers to a network host name, and if absent means to connect to the local machine via a unix domain socket.
[example]
Each host can have multiple displays, and each display can have multiple screens. Screens aren't used much anymore, with xinerama and now xrandr combining multiple screens into a single logical screen.
Try starting a terminal, switch to a different user and start xclock:
[exile] druuna ~ $ su - jade
Password:
[exile] jade ~ $ xclock
Error: Can't open display:
After setting the DISPLAY variable (by jade in the above example), the following happens:
jade ~ $ export DISPLAY=exile.nemesis.nl:0.0
[exile] jade ~ $ xclock
Xlib: connection to "exile.nemesis.nl:0.0" refused by server
Xlib: No protocol specified
Error: Can't open display: exile.nemesis.nl:0.0
druuna needs to give access, otherwise the connection is refused:
[exile] druuna ~ $ xhost +exile.nemesis.nl
exile.nemesis.nl being added to access control list
Now jade can run the program:
[exile] jade ~ $ xclock
[exile] jade ~ $
If you don't have a 'real' network, you can also use 127.0.0.1 instead of the full machine name (exile.nemesis.nl in the above example).
The format of the display variable is
[host]:<display>[.screen].
host refers to a network host name, and if absent means to connect to the local machine via a unix domain socket.
[example]
Each host can have multiple displays, and each display can have multiple screens. Screens aren't used much anymore, with xinerama and now xrandr combining multiple screens into a single logical screen.
Try starting a terminal, switch to a different user and start xclock:
[exile] druuna ~ $ su - jade
Password:
[exile] jade ~ $ xclock
Error: Can't open display:
After setting the DISPLAY variable (by jade in the above example), the following happens:
jade ~ $ export DISPLAY=exile.nemesis.nl:0.0
[exile] jade ~ $ xclock
Xlib: connection to "exile.nemesis.nl:0.0" refused by server
Xlib: No protocol specified
Error: Can't open display: exile.nemesis.nl:0.0
druuna needs to give access, otherwise the connection is refused:
[exile] druuna ~ $ xhost +exile.nemesis.nl
exile.nemesis.nl being added to access control list
Now jade can run the program:
[exile] jade ~ $ xclock
[exile] jade ~ $
If you don't have a 'real' network, you can also use 127.0.0.1 instead of the full machine name (exile.nemesis.nl in the above example).