Window manager labwc usage notes

I noticed that labwc has been around for a while, and most window managers are integrated with the desktop environment, such as Gnome's Mutter. The independent window manager is very special, especially under wayland, and labwc exists like this.

If you're tired of monolithic desktop environments like Gnome and KDE, and don't want to mess with tiling Wayland compositors like sway, try labwc's window-stacking Wayland compositor.

When I wrote this article, no one in the Chinese world shared labwc-related information, at least Google, Bing, and Baidu did not include it, and the WeChat search suggested "Lai'an Bawang Meal". This cannot but be said to be a pity, and it is also one of the motivations for me to insist on maintaining this small station.

This article will compile and install labwc in the Ubuntu 23.10 environment, so that it can be used in daily work and study. I am writing this article in a labwc related environment. Without further ado, let’s start quickly:

1. Compile and install labwc

  • Download the source code
1git clone
  • Compile and install

    • Install dependencies

      1sudo apt install libseat-dev

      If you need xwayland, I personally think you need it, because the Linux environment in mainland China is not good. Up to now, some software such as DingTalk and WeChat still have to be supported by xwayland, and cannot easily run under pure wayland.

      To enable xwayland, please install dependencies:

      1sudo apt install libxcb-composite0-de
      2sudo apt isntall libxcb-icccm4-dev
      3sudo apt install libxcb-res0-dev

      Some readers may ask, how do you know that you need these dependencies, because I need to use DingTalk for work, and I have suffered a lot. The dependent package names are all based on the error message, apt search xxx combined with experience.

    • compile

      Compile for the first time

      1meson setup build/
      2meson compile -C build/

      It is not the first compilation, pay attention to the parameter -Dxwayland=enabled, it is recommended to enable xwayland

      1meson setup --reconfigure -Dxwayland=enabled build
    • Put the command into the common directory

      After the previous step is completed, the build directory will generate labwc and copy it to the /usr/bin directory

      1sudo cp build/labwc /usr/bin

    At this point, the installation of the labwc window manager is complete. You can directly execute the labwc command in the terminal to start. After startup, it will be black (don’t panic, this is a normal operation), press Win + Enter keys, and alacritty will pop up. As shown below:


Impatient readers would like to ask, with this bare interface, which is similar to a server without a graphical interface, what else is there to play? In fact, at this time, it can already be used, but it is just a rough room. If you use the launcher or the command line to start various programs directly, they can all run normally, but there is no complete desktop environment, and the conditions are relatively difficult.

2. Add necessary desktop elements

Before further operation, it is best to ensure: 1. You can switch back to the complete Gnome environment at any time; 2. The system can automatically connect to the Internet. In such an accident, there is still a way out.

  • set wayland-sessions

    Create the labwc.desktop file, the path and content are as follows, don't tell me you won't create the file.

    1➜ ~ cat /usr/share/wayland-sessions/labwc.desktop
    2[Desktop Entry]
    7➜ ~

    The purpose is to allow gdm3 to select labwc so that you can enter the labwc environment. You can’t start it every time from the command line, right? gdm3 is the so-called display manager, or login manager, there are tui and gui, which is the thing for you to enter the user and password and select sessions after the operating system is started. This step is to give sessions one more option.

  • labwc basic configuration

    First create and download 4 core configuration files

    1mkdir -p ~/.config/labwc
    2wget -O ~/.config/labwc/environment
    3wget -O ~/.config/labwc/autostart
    4wget -O ~/.config/labwc/menu.xml
    5wget -O ~/.config/labwc/rc.xml

    Can use mine directly:

    • autostart

      1➜ labwc egrep -v "#|^$" autostart
      2swaybg -i ~/Pictures/mount.jpeg >/dev/null 2>&1 &
      3waybar >/dev/null 2>&1 &
      4fcitx5 >/dev/null 2>&1 &
      5➜ labwc pwd

      They are to set the wallpaper, activate the waybar status bar, and activate the fcitx5 input method (the input method is not required for English speakers, but Chinese readers must have it). Please modify the path of the wallpaper image by yourself. -environment

       1➜ labwc egrep -v "#|^$" environment
      11➜ labwc pwd

      Among them, MOZ_ENABLE_WAYLAND=1 allows firefox to run under wayland, XDG_CURRENT_DESKTOP=labwc is required for flameshot screen capture software, I figured it out by myself, add chicken legs! The fcitx related is what makes fcitx work properly.

      If you prefer chrome and are not used to firefox, you need to do some special settings (if xwayland support is not enabled).

      1➜ labwc grep -i exec /usr/share/applications/google-chrome.desktop
      2Exec=/usr/bin/google-chrome-stable-enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 %U
      3Exec=/usr/bin/google-chrome-stable-enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4
      4Exec=/usr/bin/google-chrome-stable --incognito-enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4

      -enable-features=UseOzonePlatform --ozone-platform=wayland is to enable wayland support

      --gtk-version=4 enables fcitx5 input method support, the candidate word interface will run away, this is the daily life of Linux users^_^

    • rc.xml

      This part has not been changed much, but shortcut keys have been added, wofi is the launcher (lancher), flameshot is the screen capture tool, and swaylock is the lock screen tool. Wofi will write a separate article later when I have time.

      1<keybind key="F8">
      2<action name="Execute" command="wofi" />
      4<keybind key="F9">
      5<action name="Execute" command="flameshot gui" />
      7<keybind key="W-l">
      8<action name="Execute" command="swaylock" />
    • menu.xml

      It is recommended to read the document and modify it as needed. You can also download mine directly. It is not important at present.

  • set waybar

    A simple understanding of waybar is a status bar that displays various basic information.


    It is recommended to install directly

    1sudo apt install waybar

    waybar can be customized, it is recommended to see official document

    There are many examples:

    Just find one you like, the author's configuration is at:

  • set swaylock

    swaylock is to lock the screen. It is a good habit to lock the screen when you leave the computer. It is fireproof, antitheft and anti-hypocrites.

    install first

    1sudo apt install swaylock

    It can also be customized, if you don’t want to bother, you can download my

    According to the settings in rc.xml, Win + l keys lock the screen, when it is used for the first time, the effect is really surprising, it looks like this (the lock screen interface cannot be screenshotted, only a network image can be found, I configured It's not as good-looking as this one).


3. Desktop overall preview

After such an operation, the result is as follows:

Dual screenshot

labwc desktop previews

    1. Status bar waybar
    1. Launcher wofi
    1. Menu (click the blank area to pop up, you can exit labwc, otherwise you don't know how to exit, right?)
    1. Proof that chrome is working fine, with a web browser you should have nothing to fear
    1. If you don’t have wofi yet, please use Alt + F3 to pop up the bemenue first, it’s not good enough

Notification screenshot

labwc notice

In the end, it is no problem to work with labwc. I plan to continue to experience it for a period of time. I may encounter various small flaws, but they are not critical. The important thing is that you can customize various components of the desktop environment according to your own preferences, avoiding being restricted by heavy environments such as Gnome/KDE, the system responds quickly (mostly written in C), and you know how these components work together , You can learn some knowledge, and you can replace it at any time if you don’t like it. This is the feeling of freedom.

Update on 2023-08-04: After 2 months of using experience, labwc runs stably and smoothly, meeting 99% of daily needs. It can be said that it is too late to meet each other, and I have bid farewell to the Gnome environment. It is recommended for Linux users. If you don’t know how to configure it, you can search for relevant tutorials on this site.

Lastmod: Friday, February 23, 2024