This is a fork of https://github.com/Cloudef/wlc which was done due to the fact that wlc will be abandoned in the near future when sway will finish their replacement.
:IRC: #orbment @ freenode :Build: |build|_
+------------------+-----------------------+ | Backends | DRM, X11, Wayland | +------------------+-----------------------+ | Contexts | EGL, Custom | +------------------+-----------------------+ | Renderers | GLESv2, Custom | +------------------+-----------------------+ | 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 | +------------------+-----------------------+
.. code:: c
// 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;
}
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) |
+-----------------------+-----------------------------------------------------+
You can set your preferred keyboard layout using XKB_DEFAULT_LAYOUT
.
See xkb documentation for more details.
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.
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
.
You can set up your own context and renderer by creating constructor functions for both that set up context and renderer. Don't forget to set up renderer as WLC_RENDERER_CUSTOM
. Use wlc_output_push_context_constructor
and wlc_output_push_renderer_constructor
to push your constructors to the top of the constructor stack (stack contains egl, no context/gles no renderer respectivelly and topmost constructor that returns true is used) for specified output.
Check platform/context/egl.c
and platform/render/gles2.c
for implementation.
Submit issues on this repo if you are developing with wlc
.
As a user of compositor, report issues to their corresponding issue trackers.
You will need following makedepends:
And the following depends:
1: Also bundled as submodule. To build from submodule use -DSOURCE_WLPROTO=ON.
And optionally:
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.
.. code:: sh
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
For now you can look at the AUR recipe <https://aur.archlinux.org/packages/wlc-git/>
_ for a example.
Releases are signed with 1AF6D26A <http://pgp.mit.edu/pks/lookup?op=vindex&search=0xF769BB961AF6D26A>
and published on GitHub <https://github.com/Cloudef/wlc/releases>
.
All 0.0.x releases are considered unstable.
See the CONTRIBUTING <CONTRIBUTING.rst>
_ for more information.
ocaml-wlc <https://github.com/Armael/ocaml-wlc>
_ - OCaml (experimental)go-wlc <https://github.com/mikkeloscar/go-wlc>
_ - Gorust-wlc <https://github.com/Immington-Industries/rust-wlc>
_ - Rustwlc.rs <https://github.com/Drakulix/wlc.rs>
_ - Rustorbment <https://github.com/Cloudef/orbment>
_ - Modular Wayland compositorocaml-loliwm <https://github.com/Armael/ocaml-loliwm>
_ - Translation of loliwm to OCamlsway <https://github.com/SirCmpwn/sway>
_ - i3-compatible window manager for Waylandway-cooler <https://github.com/Immington-Industries/way-cooler>
_ - customizeable window manager written in Rustfireplace <https://github.com/Drakulix/fireplace>
_ - Modular wayland window manager written in Rustswc <https://github.com/michaelforney/swc>
_ - A library for making a simple Wayland compositorlibwlb <https://github.com/jekstrand/libwlb>
_ - A Wayland back-end librarylibweston <https://github.com/giucam/weston/tree/libweston>
_ - Weston as a library