A library to create panels and other desktop components for Wayland using the Layer Shell protocol and GTK4
C
335
872 commits
updated Aug 16, 2026

A library for using the Layer Shell and Session Lock Wayland protocols with GTK4. This Library is compatible with C, C++ and any language that supports GObject introspection files (Python, Vala, etc).
The Layer Shell protocol allows building desktop shell components such as panels, notifications and wallpapers. It can be used to anchor your windows to a corner or edge of the output, or stretch them across the entire output.
The Session Lock protocol allows building lock screens.
AI agents are very useful, however I find their output annoying to read and frontier LLMs can not write code for this project that is consistently correct. Therefore:
This library only works on Wayland, and only on Wayland compositors that support the Layer Shell protocol. Layer shell is supported on:
--add-wayland-extension zwlr_layer_shell_v1)Layer shell is not supported on:
gtk4-layer-demo is built if examples are enabled. It's useful for testing layer shell support in compositors. Its code can be found in examples/demo/.
The easiest way to build against GTK Layer Shell is to use the gtk-layer-shell-0 pkg-config package. Refer to your build system or the pkg-config docs for further instructions. examples/simple-example.c is a minimal complete app written in C. If you link against libwayland, you must link libwayland after gtk4-layer-shell. See linking.md for details.
examples/simple-example.py contains sample Python code.
examples/simple-example.vala contains a minimal working Vala app.
@pentamassiv maintains safe Rust bindings and the crates.io crate. Rust examples can be found here.
mswiger maintains Ruby bindings which are published to RubyGems.
$ meson setup -Dexamples=true -Ddocs=true -Dtests=true build (NOTE: --prefix=/usr may be needed on Arch Linux)$ ninja -C build$ sudo ninja -C build install$ sudo ldconfigintrospection enabled: GObject introspectiondocs enabled: GTK Doctests enabled: Python3vapi enabled: ValaTo install these dependencies on Ubuntu 18.04 and later:
sudo apt install meson ninja-build libwayland-dev wayland-protocols libgtk-4-dev gobject-introspection libgirepository1.0-dev gtk-doc-tools python3 valac
To install on Arch Linux:
pacman -S --needed meson ninja gtk4 wayland wayland-protocols gobject-introspection libgirepository gtk-doc python vala
-Dexamples (default false): If to build the example C apps; gtk4-layer-demo is installed if examples are built; The Vala example is never built with the rest of the project-Ddocs (default false): If to generate the docs-Dtests (default false): If to build the tests-Dsmoke-tests (default: true): If to test that all examples can run (disable if you don't want to install the various languages and dependencies required)-Dintrospection (default: true): If to build GObject Introspection data (used for bindings to languages other than C/C++)-Dvapi (default: true): If to build VAPI data and Vala example. The VAPI file allows this library to be used in Vala. Requires -Dintrospection=trueninja -C build testninja -C build && meson test -C build --verbose <testname>GTKLS_VALGRIND=1100% MIT (unlike the GTK3 version of this library which contained GPL code copied from GTK)
C
89.7%
Python
5.9%
Meson
4.3%
A library to create panels and other desktop components for Wayland using the Layer Shell protocol and GTK4
C
335
872 commits
updated Aug 16, 2026

A library for using the Layer Shell and Session Lock Wayland protocols with GTK4. This Library is compatible with C, C++ and any language that supports GObject introspection files (Python, Vala, etc).
The Layer Shell protocol allows building desktop shell components such as panels, notifications and wallpapers. It can be used to anchor your windows to a corner or edge of the output, or stretch them across the entire output.
The Session Lock protocol allows building lock screens.
AI agents are very useful, however I find their output annoying to read and frontier LLMs can not write code for this project that is consistently correct. Therefore:
This library only works on Wayland, and only on Wayland compositors that support the Layer Shell protocol. Layer shell is supported on:
--add-wayland-extension zwlr_layer_shell_v1)Layer shell is not supported on:
gtk4-layer-demo is built if examples are enabled. It's useful for testing layer shell support in compositors. Its code can be found in examples/demo/.
The easiest way to build against GTK Layer Shell is to use the gtk-layer-shell-0 pkg-config package. Refer to your build system or the pkg-config docs for further instructions. examples/simple-example.c is a minimal complete app written in C. If you link against libwayland, you must link libwayland after gtk4-layer-shell. See linking.md for details.
examples/simple-example.py contains sample Python code.
examples/simple-example.vala contains a minimal working Vala app.
@pentamassiv maintains safe Rust bindings and the crates.io crate. Rust examples can be found here.
mswiger maintains Ruby bindings which are published to RubyGems.
$ meson setup -Dexamples=true -Ddocs=true -Dtests=true build (NOTE: --prefix=/usr may be needed on Arch Linux)$ ninja -C build$ sudo ninja -C build install$ sudo ldconfigintrospection enabled: GObject introspectiondocs enabled: GTK Doctests enabled: Python3vapi enabled: ValaTo install these dependencies on Ubuntu 18.04 and later:
sudo apt install meson ninja-build libwayland-dev wayland-protocols libgtk-4-dev gobject-introspection libgirepository1.0-dev gtk-doc-tools python3 valac
To install on Arch Linux:
pacman -S --needed meson ninja gtk4 wayland wayland-protocols gobject-introspection libgirepository gtk-doc python vala
-Dexamples (default false): If to build the example C apps; gtk4-layer-demo is installed if examples are built; The Vala example is never built with the rest of the project-Ddocs (default false): If to generate the docs-Dtests (default false): If to build the tests-Dsmoke-tests (default: true): If to test that all examples can run (disable if you don't want to install the various languages and dependencies required)-Dintrospection (default: true): If to build GObject Introspection data (used for bindings to languages other than C/C++)-Dvapi (default: true): If to build VAPI data and Vala example. The VAPI file allows this library to be used in Vala. Requires -Dintrospection=trueninja -C build testninja -C build && meson test -C build --verbose <testname>GTKLS_VALGRIND=1100% MIT (unlike the GTK3 version of this library which contained GPL code copied from GTK)
C
89.7%
Python
5.9%
Meson
4.3%