Weston

From Gentoo Wiki
Jump to:navigation Jump to:search
Resources

Weston is a reference implementation of a Wayland compositor. It is part of the Wayland project and can run as an X client or under Linux Kernel Mode Setting (KMS).

Installation

USE flags

USE flags for dev-libs/weston Wayland reference compositor

+X Add support for X11
+desktop Enable the desktop shell
+drm Enable drm compositor support
+gles2 Enable the GLESv2 renderer, not just the x11-libs/pixman-based software fallback
+resize-optimization Increase performance, allocate more RAM. Recommended to disable on Raspberry Pi
+suid Enable setuid root program(s)
editor Install wayland-editor example application
examples Install examples, usually source code
fullscreen Enable fullscreen shell
headless Headless backend and a noop renderer, mainly for testing purposes
ivi Enable the IVI shell
jpeg Add JPEG image support
kiosk Enable the kiosk shell
lcms Add lcms support (color management engine)
pipewire Enable virtual remote output with Pipewire on DRM backend
rdp Enable Remote Desktop Protocol compositor support
remoting Enable plugin to stream output to remote hosts using media-libs/gstreamer
screen-sharing Enable screen-sharing through RDP
systemd Enable use of systemd-specific libraries and features like socket activation or session tracking
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)
vnc Enable VNC (remote desktop viewer) support
wayland-compositor Enable Wayland compositor support
webp Add support for the WebP image format
xwayland Enable ability support native X11 applications

Emerge

root #emerge --ask dev-libs/weston

Usage

The Weston compositor is a minimal and fast compositor and is suitable for many embedded and mobile use cases.

Enable the examples USE flag for building example applications like weston-image or weston-view.

Weston is configured on a local level with the ~/.config/weston.ini file (cf. man 5 weston.ini).

Note
Follow the instructions below if your environment does not define XDG_RUNTIME_DIR. Weston creates its unix socket file in the directory specified by this environment variable and clients use the same variable to find that socket. [1]

The environment variable can be defined in the usual configuration files. For example, if Larry the cow (Larry) sets XDG_RUNTIME_DIR variable in his Bash shell's configuration file and he has chosen that the directory will be in /tmp.

FILE /home/larry/.bash_profileSet XDG_RUNTIME_DIR
#!/bin/bash
if test -z "${XDG_RUNTIME_DIR}"; then
    export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir
    if ! test -d "${XDG_RUNTIME_DIR}"; then
        mkdir "${XDG_RUNTIME_DIR}"
        chmod 0700 "${XDG_RUNTIME_DIR}"
    fi
fi

To launch the compositor as a standalone display server (i) enable systemd session support for weston-launch (by USE=systemd), (ii) or users without systemd are referred to the section #weston-launch without systemd below.

On a VT (outside of X), launch Weston with the DRM backend:

Note
The weston-launch command has been deprecated in version 10.0.0 and is no longer available unless weston is build with the -Ddeprecated-weston-launch=true. Instead use weston
user $weston-launch

Ditto, with XWayland support:

user $weston-launch -- --xwayland

Nest a weston instance "wayland-1" in another Weston "wayland-0":

user $WAYLAND_DISPLAY=wayland-0 weston -Swayland-1

From an X terminal, launch Weston with the x11 backend:

user $weston

weston without systemd (weston-9.0.0-r1)

As of Nov 2021 (weston-9.0.0-r1), users without systemd need the workaround below. As solved in bug #479468, weston-9999 introduced the USE flag "seatd", enabling elogind as a substitute of systemd.

You have to create the group named "weston-launch", and add the user to that group:

root #groupadd weston-launch
root #usermod -a -G weston-launch user-name

Notice: This might be unbelievable, but true: The group name "weston-launch" is hardcoded, and the command weston-launch checks if the user belongs to it. It is not relevant e.g. a device file is writable to a user.

weston without systemd (weston-10.0.0)

Users without systemd can use either seatd or elogind. Either service must be running before starting weston.

For seatd the user running weston must be a member of the video group, otherwise the unix-socket /run/seatd.sock for seatd access is not available

See also

  • Wayland — a replacement for the X11 window system protocol and architecture with the aim to be easier to develop, extend, and maintain
  • Xorg — an open source implementation of the X server.

References