• Stars
    star
    316
  • Rank 132,587 (Top 3 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created over 5 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A library to create panels and other desktop components for Wayland using the Layer Shell protocol

GTK Layer Shell (GTK3 version)

GTK Layer Shell demo screenshot

A library to write GTK applications that use Layer Shell. 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).

Documentation

GTK4 version

Reporting Bugs

To report a crash or other problem using this library open a new issue on Github. Try to include a minimum reproducer if possible (ideally in C). DO NOT REPORT GTK LAYER SHELL BUGS TO UPSTREAM GTK. If you can reproduce the problem without including or linking to the gtk-layer-shell library at all then and only then report it to GTK instead of here.

Supported Desktops

This library only works on Wayland, and only on Wayland compositors that support the Layer Shell protocol. Layer shell is supported on:

  • wlroots based compositors (such as Sway)
  • KDE Plasma on wayland
  • Mir-based compositors (some may not enable the protocol by default and require --add-wayland-extension zwlr_layer_shell_v1)

Layer shell is not supported on:

  • Gnome-on-Wayland
  • Any X11 desktop

Using the Library

Demo

gtk-layer-demo is built if examples are enabled. Its UI exposes all features of the library, and it's useful for testing layer shell support in compositors. Its code can be found in examples/demo/.

C/C++

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.

Python

examples/simple-example.py contains sample Python code.

Vala

examples/vala-standalone contains a minimal working standalone Vala project, see the readme for details.

Rust

@pentamassiv maintains safe Rust bindings and the crates.io crate. Rust examples can be found here.

Ruby

mswiger maintains Ruby bindings which are published to RubyGems.

Distro Packages

List of distros GTK Layer Shell is packaged for

Building From Source

  1. Clone this repo
  2. Install build dependencies (see below)
  3. $ meson setup -Dexamples=true -Ddocs=true -Dtests=true build
  4. $ ninja -C build
  5. $ sudo ninja -C build install
  6. $ sudo ldconfig

Build Dependencies

To install these dependencies on Ubuntu 18.04 and later:

sudo apt install meson libwayland-dev libgtk-3-dev gobject-introspection libgirepository1.0-dev gtk-doc-tools valac

Meson Options

  • -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
  • -Ddocs (default false): If to generate the docs
  • -Dtests (default false): If to build the tests
  • -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 (allows this library to be used in Vala). Requires -Dintrospection=true

Running the Tests

  • ninja -C build test

Licensing

GTK Layer Shell is licensed under the GNU Lesser General Public License version 3.0 or any later version.

Most of the individual source files are licensed under MIT.

To 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

Licensing Rationale

I 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 or any later version (a newer version of the same license as GTK). See LICENSE_LGPL.txt and LICENSE_GPL.txt for details. Almost all of the non-generated code, however, is licensed under MIT (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.

What This Means For You

This 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.

More Repositories

1

Pinecone

An unmaintained programming language
C++
865
star
2

Python-plus-plus

A framework for creating Python/C++ polyglots, programs valid in both programming languages
Shell
145
star
3

gtk4-layer-shell

A library to create panels and other desktop components for Wayland using the Layer Shell protocol and GTK4
C
132
star
4

BrainfuckIDE

A Brainfuck IDE/debugger designed to be intuitive, featureful and visually appealing
GDScript
92
star
5

wayland-debug

A command line tool to help debug Wayland clients and servers
Python
71
star
6

Hedgehog

C++ Wayland compositor
C++
17
star
7

mate-wayland-snap

Shell
11
star
8

bfstack

A Brainfuck framework
10
star
9

destylize

Browser extension to remove unicode text stylization, Now available for Firefox and Chrome (see below)
JavaScript
10
star
10

define_EVIL

8
star
11

wlbouncer

Control which Wayland protocol extensions are available to which clients on any Wayland compositor
C++
8
star
12

Object-Oriented-C

Why are we building this?
C
8
star
13

hello-wayland

Example and test Wayland apps
C
4
star
14

BrainfuckIDE_builds

Builds of my Brainfuck IDE built in Godot
4
star
15

GDMir

Godot module for building Wayland compositors with Mir
C++
4
star
16

mirco

A Mir based Wayland compositor
C++
3
star
17

solidjs-leaflet-map

Just playing around, probably not of interest to you
JavaScript
3
star
18

cpp-cheat-sheet

Demonstration of the basic concepts of the C++ language and how to use them
3
star
19

DroneRace

An open source drone racing game made with Godot (there is no PHP in this project. wtf GitHub?)
PHP
3
star
20

Skylight

The Skylight programming language
C++
2
star
21

bft

WIP Brainfuck tooling, written in Rust.
Rust
2
star
22

snap-out

Fixes the environment for an external program launched from inside a classic snap
Rust
2
star
23

nff

non-fungible files
Python
2
star
24

cryptvm

An attempt to build a Brainfuck VM with homomorphic encryption
C++
2
star
25

include_fixer

Utility to to fix broken C/C++ #includes
Python
2
star
26

7-Segment-Unicode

Make numbers look like they're on a 7 segment display
Python
2
star
27

FluidSim3D

An experimental 3D fluid dynamics simulator
C++
1
star
28

wmwwStatusline

A configurable Linux statusline written in C++ designed for use with sway and i3
C++
1
star
29

working_drm_demo

simple demo of using direct rendering manager in Linux
C++
1
star
30

desktop-environment-talk

1
star
31

4D_tic-tac-toe

A simple text based 4D tic-tac-toe game in java
Java
1
star
32

name-of

This project has moved: https://bit.ly/357tcAz
1
star
33

buzzfeed-cli

Ruby
1
star
34

wmstr

A simple yet useful UTF-8 string single header library for C++
C++
1
star
35

iron-c

WIP project to make C safe
C
1
star
36

wifi-sync

Sync saved wifi networks to a file
Python
1
star
37

widap-launcher

A simple linux program launcher
C++
1
star
38

ram_detector

A simple C program to detect the amount of used RAM on a Linux system
C
1
star
39

Brainfuck

C++
1
star
40

BattleshipTwitter

Rules for a Battleship-inspiered game to be played on Twitter
SCSS
1
star
41

personal

Scripts, helpers and configuration primarily intended for my own use
Python
1
star
42

basic-battle

Old multiplayer BASIC game
Visual Basic
1
star
43

repo-manager

A tool for managing directories of code repositories
Python
1
star
44

cmake-starter

A basic CMake C++ starter project
CMake
1
star