• Stars
    star
    331
  • Rank 127,323 (Top 3 %)
  • Language
    C
  • License
    MIT License
  • Created over 10 years ago
  • Updated almost 3 years ago

Reviews

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

Repository Details

High-level Wayland compositor library

DEPRECATION NOTICE

wlc is officially deprecated. Interested users are encouraged to use wlroots instead.

FEATURES

Backends DRM, X11, Wayland
Renderers EGL, GLESv2
Buffer API GBM, EGL streams
TTY session logind, legacy (suid)
Input libinput, xkb
Monitor Multi-monitor, DPMS
Hotplugging udev
Xwayland Supported
Clipboard Partially working
Drag'n'Drop Not implemented

EXAMPLE

// For more functional example see example/example.c

#include <stdlib.h>
#include <wlc/wlc.h>

static bool
view_created(wlc_handle view)
{
   wlc_view_set_mask(view, wlc_output_get_mask(wlc_view_get_output(view)));
   wlc_view_bring_to_front(view);
   wlc_view_focus(view);
   return true;
}

static void
view_focus(wlc_handle view, bool focus)
{
   wlc_view_set_state(view, WLC_BIT_ACTIVATED, focus);
}

int
main(int argc, char *argv[])
{
   wlc_set_view_created_cb(view_created);
   wlc_set_view_focus_cb(view_focus);

   if (!wlc_init())
      return EXIT_FAILURE;

   wlc_run();
   return EXIT_SUCCESS;
}

ENV VARIABLES

wlc reads the following env variables.

WLC_DRM_DEVICE Device to use in DRM mode. (card0 default)
WLC_BUFFER_API Force buffer API to GBM or EGL.
WLC_SHM Set 1 to force EGL clients to use shared memory.
WLC_OUTPUTS Number of fake outputs in X11/Wayland mode.
WLC_XWAYLAND Set 0 to disable Xwayland.
WLC_LIBINPUT Set 1 to force libinput. (Even on X11/Wayland)
WLC_REPEAT_DELAY Keyboard repeat delay.
WLC_REPEAT_RATE Keyboard repeat rate.
WLC_DEBUG Enable debug channels (comma separated)

KEYBOARD LAYOUT

You can set your preferred keyboard layout using XKB_DEFAULT_LAYOUT.

See xkb documentation for more details.

RUNNING ON TTY

If you have logind, you don't have to do anything.

Without logind you need to suid your binary to root user. The permissions will be dropped runtime.

BUFFER API

wlc supports both GBM and EGL streams buffer APIs. The buffer API is auto-detected based on the driver used by the DRM device.

  • GBM is supported by most GPU drivers except the NVIDIA proprietary driver.
  • EGL is only supported by the NVIDIA proprietary. If you have a NVIDIA GPU using the proprietary driver you need to enable DRM KMS using the nvidia-drm.modeset=1 kernel parameter.

You can force a given buffer API by setting the WLC_BUFFER_API environment variable to GBM or EGL.

ISSUES

Submit issues on this repo if you are developing with wlc.

As a user of compositor, report issues to their corresponding issue trackers.

BUILDING

You will need following makedepends:

  • cmake
  • git

And the following depends:

  • pixman
  • wayland 1.7+
  • wayland-protocols 1.7+ [1]
  • libxkbcommon
  • udev
  • libinput
  • libx11 (X11-xcb, Xfixes)
  • libxcb (xcb-ewmh, xcb-composite, xcb-xkb, xcb-image, xcb-xfixes)
  • libgbm (usually provided by mesa in most distros)
  • libdrm
  • libEGL (GPU drivers and mesa provide this)
  • libGLESv2 (GPU drivers and mesa provide this)

1: Also bundled as submodule. To build from submodule use -DSOURCE_WLPROTO=ON.

And optionally:

  • dbus (for logind support)
  • systemd (for logind support)

For weston-terminal and other wayland clients for testing, you might also want to build weston from git.

You can build bootstrapped version of wlc with the following steps.

git submodule update --init --recursive # - initialize and fetch submodules
mkdir target && cd target               # - create build target directory
cmake -DCMAKE_BUILD_TYPE=Upstream ..    # - run CMake
make                                    # - compile

# You can now run (Ctrl-Esc to quit)
./example/example

PACKAGING

For now you can look at the AUR recipe for a example.

Releases are signed with B22DA89A and published on GitHub.

All 0.0.x releases are considered unstable.

CONTRIBUTING

See the CONTRIBUTING for more information.

BINDINGS

SOFTWARE USING WLC

  • orbment - Modular Wayland compositor
  • ocaml-loliwm - Translation of loliwm to OCaml
  • sway - i3-compatible window manager for Wayland
  • way-cooler - customizeable window manager written in Rust
  • fireplace - Modular wayland window manager written in Rust

SIMILAR SOFTWARE

  • ewlc - A separately maintained fork of wlc
  • swc - A library for making a simple Wayland compositor
  • libwlb - A Wayland back-end library
  • libweston - Weston as a library

More Repositories

1

bemenu

Dynamic menu library and client program inspired by dmenu
C
1,181
star
2

orbment

Modular Wayland compositor
C
246
star
3

zig-aio

io_uring like asynchronous API and coroutine powered IO tasks for zig
Zig
113
star
4

zig2nix

Flake for packaging, building and running Zig projects.
Nix
62
star
5

android2gnulinux

AOSP/Bionic compatiblity layer for GLIBC systems
C
60
star
6

nix-zig-stdenv

cross-compile nixpkgs with zig
Nix
45
star
7

monsterwm-xcb

Port of monsterwm to xcb
C
36
star
8

chck

Collection of C utilities taken and cleaned up from my other projects
C++
34
star
9

PKGBUILDS

ArchLinux specific pkgbuilds
C
28
star
10

elden-proton

Noob friendly Elden Ring mod loader for linux/proton/steam
Shell
26
star
11

zig-router

Straightforward HTTP-like request routing.
Zig
20
star
12

pokeemerald-randomizer

Pokemon emerald randomizer
C
19
star
13

dotfiles-ng

dotfiles for new ArchLinux install
Shell
17
star
14

macopix-fork

Fork of macopix with few bugs fixed and animation signaling.
Shell
16
star
15

dotFiles

Home Folder
Shell
16
star
16

nix-autoenv

nix-direnv alternative that does not need a .direnv metafile
Nix
13
star
17

mach-flake

Flake that allows you to get started with Mach engine quickly.
Nix
12
star
18

glhck

OpenGL framework
C
10
star
19

buildhck

Micro build automation client/server framework
Python
10
star
20

vcable

Audio plugin acting as virtual routing cable
C
9
star
21

libasound-sndio

libasound implementation that uses sndio (not full implementation, but hopefully enough to replace the real thing eventually)
C
9
star
22

oblogout-fork

ConsoleKit && UPower backend and support for multiple monitors
Python
8
star
23

zig-budoux

Budoux for Zig and C
Zig
7
star
24

OGLFramework

Playing around with OpenGL / GLES
C
7
star
25

memutils

Various process memory related utilities for Linux
C
7
star
26

glcapture

Mirror
C
6
star
27

nixos-flake

My nixos configuration
Nix
6
star
28

libpndman

Package management library for PND files.
C
5
star
29

archlinuxarm-pandora

Pandora specific archlinux arm PKGBUILDs
Shell
4
star
30

guhck

Convert, extract, view .hack//G.U (ccs) files
C
4
star
31

cow-notify

Execute custom command at notify events.
C
4
star
32

inihck

INI parser
C
3
star
33

libmmd

MikuMikuDance importer
C
3
star
34

lightbot

Crappy C IRC Bot
C
3
star
35

pi9

9p server abstraction library
C
3
star
36

dwm-fork

personal dwm
C
2
star
37

mtouch-etp

For backup purposes, may be cleaned and upstream'd
C
2
star
38

fspec

backup
C
2
star
39

colhck

Temporary git for glhck's upcomming collision code.
C
2
star
40

pid-defer

Run processes that will be cleaned up when other process exits. (Linux only)
Zig
2
star
41

makepnd

So it begins...
Shell
2
star
42

dropbox-crap

Dropbox daemon && library in bash
1
star
43

reactivec

Why does this git repository exist?
1
star
44

SDL_sound

SDL_sound with mkxp patches (pending upstream)
C
1
star
45

glinject

OpenGL injector thingy
C
1
star
46

PUR

PND User Repository
Python
1
star
47

texhck

Texture compression library
C
1
star
48

srv.birth

glhck && enet sandbox project
C
1
star
49

zig-fsm-compiler

Ragel compatible FSM compiler for Zig
Zig
1
star
50

spurdo-editor

spurdo spΓ€rde :D
Zig
1
star