• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H26-Jan-2022-4942

doc/H26-Jan-2022-140123

examples/H26-Jan-2022-1,2791,005

gtk-priv/H26-Jan-2022-12,24210,149

include/H26-Jan-2022-39754

protocol/H26-Jan-2022-1,5791,316

src/H26-Jan-2022-2,2641,653

test/H03-May-2022-2,6071,759

.editorconfigH A D26-Jan-2022115 97

.gitignoreH A D26-Jan-202256 65

CHANGELOG.mdH A D26-Jan-20224.1 KiB7261

README.mdH A D26-Jan-20224.8 KiB6952

compatibility.mdH A D26-Jan-20221.7 KiB2823

meson.buildH A D26-Jan-20221.4 KiB5239

release_process.mdH A D26-Jan-20221.1 KiB1918

README.md

1# GTK Layer Shell
2
3![GTK Layer Shell demo screenshot](https://i.imgur.com/dIuYcBM.png)
4
5A library to write [GTK](https://www.gtk.org/) applications that use [Layer Shell](https://github.com/swaywm/wlr-protocols/blob/master/unstable/wlr-layer-shell-unstable-v1.xml). Layer Shell is a Wayland protocol for desktop shell components, such as panels, notifications and wallpapers. You can use it to anchor your windows to a corner or edge of the output, or stretch them across the entire output. It supports all Layer Shell features including popups and popovers (GTK popups Just Work™). This Library is compatible with C, C++ and any language that supports GObject introspection files (Python, Vala, etc, see using the library below).
6
7## Supported Desktops
8This library only works on Wayland, and only on Wayland compositors that support the Layer Shell protcol. Layer shell __is supported__ on:
9- wlroots based compositors (such as __Sway__)
10- Mir-based compositors (some may not enable the protocol by default and require `--add-wayland-extension zwlr_layer_shell_v1`)
11
12Layer shell __is not supported__ on:
13- Gnome-on-Wayland
14- Any X11 desktop
15
16## Distro Packages
17[![List of distros GTK Layer Shell is packaged for](https://repology.org/badge/vertical-allrepos/gtk-layer-shell.svg)](https://repology.org/project/gtk-layer-shell/versions)
18
19## Building From Source
201. Clone this repo
212. Install build dependencies (see below)
223. `$ meson build -Dexamples=true -Ddocs=true -Dtests=true`
234. `$ ninja -C build`
245. `$ sudo ninja -C build install`
256. `$ sudo ldconfig`
26
27### Build Dependencies
28* [Meson](https://mesonbuild.com/) (>=0.45.1)
29* [libwayland](https://gitlab.freedesktop.org/wayland/wayland) (>=1.10.0)
30* [GTK3](https://www.gtk.org/) (>=3.22.0)
31* [GObject introspection](https://gitlab.gnome.org/GNOME/gobject-introspection/)
32* [GTK Doc](https://www.gtk.org/gtk-doc/) (only required if docs are enabled)
33
34To install these dependencies on Ubuntu 18.04 and later:
35```
36sudo apt install meson libwayland-dev libgtk-3-dev gobject-introspection libgirepository1.0-dev gtk-doc-tools
37```
38
39### Meson Options
40* `-Dexamples` (default `false`): If to build the example C apps; gtk-layer-demo is installed if examples are built; The Vala example is never built with the rest of the project
41* `-Ddocs` (default `false`): If to generate the docs
42* `-Dtests` (default `false`): If to build the tests
43* `-Dintrospection` (default: `true`): If to build GObject Introspection data (used for bindings to langauges other than C/C++)
44
45### Running the Tests
46* `ninja -C build test`
47
48## Using the Library
49* `gtk-layer-demo` is installed if examples are enabled. Its UI exposes all features of the library, and it's useful for testing layer shell support in compositors
50* [gtk-layer-shell.h](include/gtk-layer-shell.h) shows the full API, which can be used directly in C or C++
51* [examples/simple-example.c](examples/simple-example.c) is a minimal working C app
52* [examples/demo/](examples/demo/) contains the code for `gtk-layer-demo` (a more complex app)
53* The easiest way to build C and C++ apps is to use the `gtk-layer-shell-0` pkg-config package. Refer to your build system or the pkg-config docs for further instructions
54* [examples/vala-standalone](examples/vala-standalone) contains a minimal working standalone Vala project, see [the readme](examples/vala-standalone/README.md) for details
55* [examples/simple-example.py](examples/simple-example.py) contains sample Python code
56
57## Licensing
58GTK Layer Shell is licensed under the GNU Lesser General Public License version 3.0 or any later version.
59
60Most of the individual source files are licensed under MIT.
61
62To prevent possible future confusion, all contributions must contain the following in the PR message: *By opening this pull request, I agree for my modifications to be licensed under whatever licenses are indicated at the start of the files I modified*
63
64### Licensing Rationale
65I want everyone to be able to use GTK Layer Shell however they desire, but parts of it are extracted from GTK. Therefore, the project as a whole is licensed under [GNU Lesser General Public License (LGPL) version 3](https://www.gnu.org/licenses/lgpl-3.0.en.html) or any later version (a newer version of the same license as GTK). See [LICENSE_LGPL.txt](LICENSE_LGPL.txt) and [LICENSE_GPL.txt](LICENSE_GPL.txt) for details. Almost all of the non-generated code, however, is licensed under [MIT](https://en.wikipedia.org/wiki/MIT_License) ([LICENSE_MIT.txt](LICENSE_MIT.txt)). At the top of each file should be a header that specifies which license applies to it. Please refer to that if in doubt.
66
67### What This Means For You
68This library can be linked against under similar terms as GTK itself, so licensing shouldn't be a problem for most potential users. Furthermore, most of the code within this library can be used in permissively licensed or proprietary projects.
69