Skip to content

Commit c537252

Browse files
committed
feat(weston): explain the wayland_display variable
Explain the WAYLAND_DISPLAY variable more since I've gotten questions about it's usage recently. Call out XDG_RUNTIME_DIR as well, to avoid issues. Signed-off-by: Randolph Sapp <[email protected]>
1 parent a27a551 commit c537252

File tree

1 file changed

+21
-1
lines changed
  • source/linux/Foundational_Components/Graphics/Common

1 file changed

+21
-1
lines changed

source/linux/Foundational_Components/Graphics/Common/Weston.rst

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ If you need to interact with this instance with any other user, then make sure
5858
that user is capable of interacting with the wayland socket. This will be
5959
:file:`wayland-1` under the ``weston`` user's ``XDG_RUNTIME_DIR``,
6060
:file:`/run/user/1000/`. We do not recommend running graphical applications as
61-
root.
61+
root. See :ref:`running-weston-clients` for more information.
6262

6363
To start the systemd service manually, do the following:
6464

@@ -147,6 +147,8 @@ following will stop it:
147147
It is also possible to start Weston from the native console, exit
148148
Weston by pressing Ctrl-Alt-Backspace.
149149

150+
.. _running-weston-clients:
151+
150152
**********************
151153
Running Weston clients
152154
**********************
@@ -155,6 +157,24 @@ Weston client examples can run from the command line on a serial port
155157
console or an SSH console. After launching Weston, the user should be
156158
able to use the keyboard and the mouse for various controls.
157159

160+
The ``WAYLAND_DISPLAY`` variable informs clients what socket they should
161+
interact with. Typically these sockets are under the ``XDG_RUNTIME_DIR``,
162+
allowing ``WAYLAND_DISPLAY`` to be a file name. The ``WAYLAND_DISPLAY`` variable
163+
can also be a full path to the socket.
164+
165+
Applications stated from terminal sessions running under the Weston process will
166+
have this variable set automatically. If it is not set automatically and the
167+
process is running under the same user as Weston, then you should only have to
168+
set ``WAYLAND_DISPLAY`` to :file:`wayland-{X}`. Here ``X`` is the session
169+
number, which should start at 1 and increment for each simultaneous instance of
170+
Weston started.
171+
172+
Do not set the ``XDG_RUNTIME_DIR`` variable to any other user's runtime
173+
directory. This will cause issues with other applications. If that user can
174+
interact with another users socket, point ``WAYLAND_DISPLAY`` to the full path
175+
of the socket instead. For example ``WAYLAND_DISPLAY=/run/user/1000/wayland-1``
176+
allows an application to interact with user ID 1000's session.
177+
158178
.. code-block:: console
159179
160180
# /usr/bin/weston-flower

0 commit comments

Comments
 (0)