Code Monkey home page Code Monkey logo

wlc's Introduction

IRC:#orbment @ freenode
Build:build

Project is in low-maintenance mode and will be abadoned in future. Consider forking if you want to keep using the codebase.

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 1AF6D26A 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

  • swc - A library for making a simple Wayland compositor
  • libwlb - A Wayland back-end library
  • libweston - Weston as a library

wlc's People

Contributors

abique avatar ammen99 avatar aomader avatar cl91 avatar cloudef avatar crondog avatar ddevault avatar deathlyfrantic avatar drakulix avatar earnestly avatar enerccio avatar fluxchief avatar holysmoke86 avatar hummer12007 avatar jwrdegoede avatar kozec avatar linkmauve avatar ljrk0 avatar lkundrak avatar mikkeloscar avatar sardemff7 avatar sce avatar snirkimmington avatar stebalien avatar valpackett avatar vially avatar xerpi avatar yohanesu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.