README.rst 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. .. |build| image:: http://build.cloudef.pw/build/wlc/master/linux%20x86_64/current/status.svg
  2. .. _build: http://build.cloudef.pw/build/wlc/master/linux%20x86_64
  3. :IRC: #orbment @ freenode
  4. :Build: |build|_
  5. FEATURES
  6. --------
  7. +------------------+-----------------------+
  8. | Backends | DRM, X11 |
  9. +------------------+-----------------------+
  10. | Renderers | EGL, GLESv2 |
  11. +------------------+-----------------------+
  12. | TTY session | logind, legacy (suid) |
  13. +------------------+-----------------------+
  14. | Input | libinput, xkb |
  15. +------------------+-----------------------+
  16. | Monitor | Multi-monitor, DPMS |
  17. +------------------+-----------------------+
  18. | Hotplugging | udev |
  19. +------------------+-----------------------+
  20. | Xwayland | Supported |
  21. +------------------+-----------------------+
  22. | Clipboard | Partially working |
  23. +------------------+-----------------------+
  24. | Drag'n'Drop | Not implemented |
  25. +------------------+-----------------------+
  26. EXAMPLE
  27. -------
  28. .. code:: c
  29. // For more functional example see example/example.c
  30. #include <stdlib.h>
  31. #include <wlc/wlc.h>
  32. static bool
  33. view_created(wlc_handle view)
  34. {
  35. wlc_view_bring_to_front(view);
  36. wlc_view_focus(view);
  37. return true;
  38. }
  39. static void
  40. view_focus(wlc_handle view, bool focus)
  41. {
  42. wlc_view_set_state(view, WLC_BIT_ACTIVATED, focus);
  43. }
  44. int
  45. main(int argc, char *argv[])
  46. {
  47. static struct wlc_interface interface = {
  48. .view = {
  49. .created = view_created,
  50. .focus = view_focus,
  51. },
  52. };
  53. if (!wlc_init(&interface, argc, argv))
  54. return EXIT_FAILURE;
  55. wlc_run();
  56. return EXIT_SUCCESS;
  57. }
  58. OPTIONS
  59. -------
  60. ``wlc`` reads the following options on init.
  61. +-----------------------+------------------------------------------------+
  62. | ``--log FILE`` | Logs output to specified ``FILE``. |
  63. +-----------------------+------------------------------------------------+
  64. ENV VARIABLES
  65. -------------
  66. ``wlc`` reads the following env variables.
  67. +----------------------+------------------------------------------------------+
  68. | ``WLC_DRM_DEVICE`` | Device to use in DRM mode. (card0 default) |
  69. +----------------------+------------------------------------------------------+
  70. | ``WLC_SHM`` | Set 1 to force EGL clients to use shared memory. |
  71. +----------------------+------------------------------------------------------+
  72. | ``WLC_OUTPUTS`` | Number of fake outputs in X11 mode. |
  73. +----------------------+------------------------------------------------------+
  74. | ``WLC_BG`` | Set 0 to disable the background GLSL shader. |
  75. +----------------------+------------------------------------------------------+
  76. | ``WLC_XWAYLAND`` | Set 0 to disable Xwayland. |
  77. +----------------------+------------------------------------------------------+
  78. | ``WLC_DIM`` | Brightness multiplier for dimmed views (0.5 default) |
  79. +----------------------+------------------------------------------------------+
  80. | ``WLC_LIBINPUT`` | Set 1 to force libinput. (Even on X11) |
  81. +----------------------+------------------------------------------------------+
  82. | ``WLC_REPEAT_DELAY`` | Keyboard repeat delay. |
  83. +----------------------+------------------------------------------------------+
  84. | ``WLC_REPEAT_RATE`` | Keyboard repeat rate. |
  85. +----------------------+------------------------------------------------------+
  86. | ``WLC_DEBUG`` | Enable debug channels (comma separated) |
  87. +----------------------+------------------------------------------------------+
  88. KEYBOARD LAYOUT
  89. ---------------
  90. You can set your preferred keyboard layout using ``XKB_DEFAULT_LAYOUT``.
  91. See xkb documentation for more details.
  92. RUNNING ON TTY
  93. --------------
  94. If you have ``logind``, you don't have to do anything.
  95. Without ``logind`` you need to suid your binary to root user.
  96. The permissions will be dropped runtime.
  97. ISSUES
  98. ------
  99. Submit issues on this repo if you are developing with ``wlc``.
  100. As a user of compositor, report issues to their corresponding issue trackers.
  101. BUILDING
  102. --------
  103. You will need following makedepends:
  104. - cmake
  105. - git
  106. And the following depends:
  107. - pixman
  108. - wayland
  109. - libxkbcommon
  110. - udev
  111. - libinput
  112. You will also need these for building, but they are optional runtime:
  113. - libx11
  114. - libxcb
  115. - mesa, nvidia, etc.. (GLESv2, EGL, DRM)
  116. And optionally:
  117. - dbus (for logind support)
  118. - systemd (for logind support)
  119. For weston-terminal and other wayland clients for testing, you might also want to build weston from git.
  120. You can build bootstrapped version of ``wlc`` with the following steps.
  121. .. code:: sh
  122. git submodule update --init --recursive # - initialize and fetch submodules
  123. mkdir target && cd target # - create build target directory
  124. cmake -DCMAKE_BUILD_TYPE=Debug .. # - run CMake
  125. make # - compile
  126. # You can now run (Ctrl-Esc to quit)
  127. ./example/example
  128. PACKAGING
  129. ---------
  130. For now you can look at the `AUR recipe <https://aur.archlinux.org/packages/wlc-git/>`_ for a example.
  131. CONTRIBUTING
  132. ------------
  133. See the `CONTRIBUTING <CONTRIBUTING.rst>`_ for more information.
  134. BINDINGS
  135. --------
  136. - `ocaml-wlc <https://github.com/Armael/ocaml-wlc>`_ - OCaml (experimental)
  137. SOFTWARE USING WLC
  138. ------------------
  139. - `orbment <https://github.com/Cloudef/orbment>`_ - Modular Wayland compositor
  140. - `ocaml-loliwm <https://github.com/Armael/ocaml-loliwm>`_ - Translation of loliwm to OCaml
  141. - `sway <https://github.com/SirCmpwn/sway>`_ - i3-compatible window manager for Wayland
  142. SIMILAR SOFTWARE
  143. ----------------
  144. - `swc <https://github.com/michaelforney/swc>`_ - A library for making a simple Wayland compositor
  145. - `libwlb <https://github.com/jekstrand/libwlb>`_ - A Wayland back-end library
  146. - `libweston <https://github.com/giucam/weston/tree/libweston>`_ - Weston as a library