labwc Desktop Environment
labwc is a configurable and lightweight wlroots-based Wayland-compatible desktop environment.
As of May 2025, Labwc is no longer the default compositor in Ghaf.
Labwc can still be explicitly enabled by specifying the configuration option profiles.graphics.compositor = "labwc"
or adjusting the default compositor value in graphics.nix.
The basis of the labwc configuration is the set of following files: rc.xml
, menu.xml
, autostart
, and environment
. These files can be edited by substituting in the labwc overlay overlays/custom-packages/labwc/default.nix
.
Window Border Coloring
Section titled “Window Border Coloring”The border color concept illustrates the application trustworthiness in a user-friendly manner. The color shows the application’s security level and allows avoiding user’s mistakes. The same approach can be found in other projects, for example, QubeOS.
Ghaf uses patched labwc which makes it possible to change the border color for the chosen application. The implementation is based on window rules by substituting the server decoration colors (serverDecoration
= yes
). The borderColor
property is responsible for the frame color.
For example, the foot terminal with Aqua colored frame:
<windowRules> <windowRule identifier="Foot" borderColor="#00FFFF" serverDecoration="yes" skipTaskbar="yes" /> <windowRule identifier="firefox" borderColor="#FF0000" serverDecoration="yes" skipTaskbar="yes" /></windowRules>
Touch Display Mapping in Labwc
Section titled “Touch Display Mapping in Labwc”Overview
Section titled “Overview”With a touch-capable display connected, touch input may be misaligned in multi-display setups using Labwc. The touch area often spans all connected screens instead of the intended one. To resolve this, the touch input must be explicitly mapped to the correct display output.
Configuration
Section titled “Configuration”Add the following entry to Ghaf’s Labwc configuration in labwc.config.nix:
<touch deviceName="[libinput device name]" mapToOutput="[display output name]" mouseEmulation="no"/>
deviceName
: Name of the touch input device fromlibinput list-devices
mapToOutput
: Name of the display output (e.g.,DP-1
)
Steps How To Get The Correct deviceName
and display output
Section titled “Steps How To Get The Correct deviceName and display output”- In Ghaf, run
libinput list-devices
to get the touch device name. - In Ghaf, run
wlr-randr
to get the display port used by the touch device (e.g.DP-1
). - Add the
<touch>
config entry to the Ghaf Labwc config in labwc.config.nix. - Rebuild the target Ghaf system.
Example Touch Config Entry
Section titled “Example Touch Config Entry”<touch deviceName="FlatFrog FlatFrog DA-TK55P-20P2WE-M4-00e5" mapToOutput="DP-1" mouseEmulation="no"/>
- Ensure names match exactly.
- Mapping may need to be updated if ports or displays change.
- Labwc touch config documentation: https://labwc.github.io/labwc-config.5.html#touch