A New Release of Raspberry Pi OS with Labwc – A New Wayland Compositor

The Raspberry Pi OS has been at the forefront of enabling users to explore the full potential of the Raspberry Pi platform. The latest release comes with an exciting addition that’s going to explode in 2025 next year, the Labwc (Lightweight Wayland Compositor) – a minimalist and fast window manager for Wayland. This shift towards Wayland aligns with the broader trend in the Linux ecosystem to adopt this modern display server protocol, replacing the legacy X11 server.

Labwc is designed to be a light and responsive compositor, maintaining simplicity without compromising functionality. It makes a good choice for those looking to reduce resource overhead on their Raspberry Pi devices, particularly on the Raspberry Pi 3 or Raspberry Pi 4 models. In this guide, we will review the features and performance of this new addition and provide code examples on how to get it running on Raspberry Pi OS.

#1 What is Labwc?

Labwc stands for Lightweight Wayland Compositor. It is inspired by Openbox, a lightweight window manager for the X11 display server, but it leverages the modern Wayland protocol, which is designed to offer a more secure, efficient, and scalable system.

Key features of Labwc include:

  •  Minimalism: Labwc offers a clean and simple user interface with little overhead
  • Extensibility: It is easily extensible through shell scripts and can integrate well with other Wayland components.
  • Speed and Efficiency: Due to its lightweight nature, it runs well even on devices with limited resources, such as the Raspberry Pi.
  • Compatibility: Although minimal, it is compatible with many standard Linux applications that support Wayland.

#2 Setup Labwc & Installation Guide

Step i – Update Raspberry Pi OS

Before you begin installing Labwc, it is essential to ensure your Raspberry Pi OS is up to date.

Open a terminal on your Raspberry Pi and run the following commands:

sudo apt update
sudo apt full-upgrade

This will update your package repositories and install any pending updates.

Step ii – Installing Labwc

Labwc may not be available directly in the standard Raspberry Pi OS repositories, so you might need to install it manually from a third-party repository or compile it from source.

To install Labwc from a third-party repository:

i. Add the necessary repository to your sources list.

echo "deb http://deb.debian.org/debian sid main" | sudo tee -a /etc/apt/sources.list
sudo apt update

ii. Install Labwc and any necessary dependencies.

sudo apt install labwc

This will install Labwc along with its dependencies.

#Step 3 – Configuring Labwc

Once installed, Labwc requires some basic configuration. You can create a configuration directory for Labwc:

mkdir -p ~/.config/labwc

Create a `rc.xml` configuration file in the `~/.config/labwc/` directory to define how the window manager behaves. This configuration file allows you to customize window behavior, keyboard shortcuts, and more.

Here is a basic `rc.xml` configuration file:

<?xml version="1.0"?>
<openbox_config>
<applications>
<!-- Define application-specific behavior here -->
</applications>

<keyboard>
<!-- Keybindings -->
<keybind key="W-Return">
<action name="Execute">
<command>alacritty</command>
</action>
</keybind>
<keybind key="W-q">
<action name="Close"/>
</keybind>
</keyboard>

<mouse>
<!-- Mouse behavior -->
<context name="Frame">
<mousebind button="Left" action="Press">
<action name="Move"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Resize"/>
</mousebind>
</context>
</mouse>
</openbox_config>

The configuration file above defines a few basic settings:

  •  `W-Return`: Opens the terminal (Alacritty)
  • `W-q`: Closes the currently focused window.
  • Mouse bindings for moving and resizing windows using left and right mouse buttons.

You can adjust the settings according to your preferences.

#Step 4 – Running Labwc

To start Labwc as your Wayland compositor, you can use a display manager like `greetd`, or you can start it manually from a TTY session.

To start Labwc manually:

  • i. First, switch to a TTY session by pressing `Ctrl + Alt + F2`
  • ii. Log in and run the following command to start a Wayland session with Labwc:
labwc

Labwc will now start as your Wayland window manager, and you can begin using it.

#5 Performance and User Experience

Labwc’s minimalism is its strength. The window manager runs smoothly on Raspberry Pi devices, especially the Raspberry Pi 4. Even with minimal hardware resources, Labwc offers an excellent user experience, making the system feel responsive and fluid.

Compared to other more feature-rich compositors like GNOME or KDE, Labwc consumes far fewer system resources. This makes it ideal for users who prioritize performance and simplicity over extensive graphical effects and complex UI features.

For those coming from Openbox, the transition is relatively easy, as Labwc retains much of the simplicity that Openbox is known for. The configuration is lightweight, and customizing keybindings or window behaviors is straightforward. Additionally, it integrates well with various Linux applications that support Wayland.

#6 Launching a Custom Application

If you wish to extend Labwc’s functionality to launch a custom application with specific keybindings, you can modify the `rc.xml` file as shown below:

<keybind key="W-Firefox">
<action name="Execute">
<command>firefox</command>
</action>
</keybind>

In this example, pressing `Super (W) + Firefox` will launch the Firefox browser. You can replace `firefox` with any other application you would like to launch. The addition of Labwc as a Wayland compositor in the latest release of Raspberry Pi OS is a welcome improvement for users looking for a lightweight and efficient window manager. Its minimal footprint makes it ideal for devices like the Raspberry Pi, where system resources are limited. Despite its simplicity, Labwc offers ample flexibility in configuration, allowing users to tailor it to their needs. For those who are already familiar with window managers like Openbox, Labwc offers an easy transition to Wayland while maintaining the same level of simplicity and performance. Its adoption in the Raspberry Pi OS ecosystem is a positive step towards embracing modern Linux technologies without compromising on performance or usability.