Trying Out the Wayland Compositor Weston on Arch Linux

 2015-05-25

 2022-07-30

 Linux

This article is the English translation of the Japanese article titled ‘Arch LinuxでWaylandコンポジタWestonを動かしてみる’.


Hello! In this post, we’re going to explore the topic: “Trying Out the Wayland Compositor Weston on Arch Linux.” Wayland has been attracting attention as the next-generation display server, and I wanted to see it in action. However, since Wayland is still under development, this post is more of a “trying it out” report rather than something practical.

Wayland – The Next-Generation Display Server

Wayland is a new display server protocol expected to eventually replace the X.org server. Currently, X.org is essential for building GUI environments on UNIX systems. But due to continuous expansion and patching over the years, it’s reaching its limits when it comes to supporting modern, refined UIs. That’s why new display servers like Mir and Wayland have been developed.

Wayland, in particular, has become easy enough to try out. While it has some hardware and driver constraints, it can even run on top of X, making it possible to play around with even if native startup isn’t an option.

Setting Up an Environment to Run Wayland

To try out Wayland, you’ll need a compositor. Weston is a convenient choice for this purpose. In this post, we’ll use Weston to experience Wayland.

Installing Weston

You can install Weston using the following command:

sudo pacman -S weston

Starting Weston

There are several ways to launch Weston. In this post, we’ll run it on top of X and also directly in a KMS (Kernel Mode Setting) environment.

Running Weston on X

To run Weston on X, enter the following command:

weston

You should see Weston launch, as shown in the screenshot below:

01

Running Weston with DRM/KMS

This means launching Weston natively from the console. There are some restrictions—it only works on systems that support KMS. If you’re using proprietary drivers (like from Nvidia), it won’t work. In this post, I used the Intel driver.

Preparation & Confirmation:
First, switch to a command-line login. You can do this by pressing Ctrl + Alt + F2~F6, or by stopping the display manager and rebooting:

sudo systemctl disable lightdm.service

Next, check if a KMS/DRM driver is active by running:

lsmod | grep '(i915|radeon|nouveau)'

If you see i915, radeon, or nouveau, you should be good to go.

Launching Weston:
Now, start Weston using this command:

weston-launch

Trying Out Weston Demos

Weston comes with several demos. While they aren’t practical, they are fun to play around with. Here are a few demo commands:

weston-smoke &
weston-flower &
weston-img <image file> &

02

Customizing Weston

Weston, when launched by default, is a plain gray screen with just a terminal launcher—not the most user-friendly. You can customize it by creating/editing ~/.config/weston.ini.

vim ~/.config/weston.ini

Here’s how I configured mine (adjust paths and settings as needed for your system):

[core]
## uncomment this line for xwayland support ##
#modules=desktop-shell.so,xwayland.so

[shell]
background-image=/usr/share/background/wallpaper_blue.jpg
background-color=0xff002244
panel-color=0xff465760
locking=true
animation=zoom

[keyboard]
keymap_rules=evdev
keymap_layout=jp
#keymap_options=caps:ctrl_modifier,shift:both_capslock_cancel

[terminal]
#font=DroidSansMono
#font-size=14

[launcher]
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
path=/usr/bin/weston-terminal

[launcher]
icon=/usr/share/icons/hicolor/24x24/apps/firefox.png
path=/usr/bin/firefox

[launcher]
icon=/usr/share/icons/gnome/22x22/apps/accessories-text-editor.png
path=/usr/bin/mousepad

[screensaver]
# Uncomment path to disable screensaver
path=/usr/libexec/weston-screensaver
duration=600

[input-method]
path=/usr/libexec/weston-keyboard

After customizing, launch Weston again—you’ll see the background and panel colors change. The keyboard layout is also now set for Japanese input.

03

Running X Applications on Weston

Currently, most applications are built to run on X. By default, they won’t work on Wayland/Weston. To fix this, we can install xorg-server-xwayland to enable X apps under Weston.

Install it with:

sudo pacman -S xorg-server-xwayland

Then edit your ~/.config/weston.ini like this:

[core]
modules=xwayland.so

Now, apps like web browsers and editors can run under Weston. If you launch Weston natively (using DRM/KMS), it can function as a full desktop environment. However, Japanese input doesn’t start automatically, so I manually launched Fcitx from the terminal.

Here’s a screenshot of Weston running natively (on DRM/KMS):

04

Conclusion

Wayland is touted as the next-generation replacement for X.org, but it’s still under development. Right now, it’s more of a playground than a daily driver. On my setup (Intel graphics), I experienced a lot of screen flickering and unstable behavior.

Also, tasks like taking screenshots differ from the X.org approach, which further hurts practicality for daily use. That said, development is progressing—GNOME is also being adapted to run on Wayland—so it’s worth keeping an eye on future updates.


Let me know if you’d like this formatted as a blog post or exported to a specific format!