README.md
1# Hikari - Wayland Compositor
2
3![Screenshot](https://acmelabs.space/~raichoo/hikari.png)
4
5## Description
6
7_hikari_ is a stacking Wayland compositor with additional tiling capabilities,
8it is heavily inspired by the Calm Window manager (cwm(1)). Its core concepts
9are *views*, *groups*, *sheets* and the *workspace*.
10
11The workspace is the set of views that are currently visible.
12
13A sheet is a collection of views, each view can only be a member of a single
14sheet. Switching between sheets will replace the current content of the
15workspace with all the views that are a member of the selected sheet. _hikari_
16has 9 general purpose sheets that correspond to the numbers **1** to **9** and a
17special purpose sheet **0**. Views that are a member of sheet **0** will
18always be visible but stacked below the views of the selected sheet.
19
20Groups are a bit more fine grained than sheets. Like sheets, groups are a
21collection of views. Unlike sheets you can have a arbitrary number of groups
22and each group can have an arbitrary name. Views from one group can be spread
23among all available sheets. Some operations act on entire groups rather than
24individual views.
25
26## Setting up Wayland on FreeBSD
27
28Wayland currently requires some care to work properly on FreeBSD. This section
29aims to document the recent state of how to enable Wayland on the FreeBSD
30`STABLE` branch and will change once support is being improved.
31
32### Mouse configuration
33
34To make mice work `kern.evdev.rcpt_mask` should be set to `12`. Depending on
35your version of FreeBSD this is done automatically or via setting the value in
36`/etc/sysctl.conf`.
37
38Some systems might require `moused` for mice to work. Enable it with `service
39moused enable`. This requires setting `kern.evdev.rcpt_mask` to `3`.
40
41### Setting up XDG\_RUNTIME\_DIR
42
43This section describes how to use `/tmp` as your `XDG_RUNTIME_DIR`. Some Wayland
44clients (e.g. native Wayland `firefox`) require `posix_fallocate` to work in
45that directory. This is not supported by ZFS, therefore you should prevent the
46ZFS tmp dataset from mounting to `/tmp` and `mount -t tmpfs tmpfs /tmp`. To
47persist this setting edit your `/etc/fstab` appropriately to automatically mount
48`tmpfs` during boot.
49
50Additionally set `XDG_RUNTIME_DIR` to `/tmp` in your environment.
51
52### Setting up PAM
53
54Setting up PAM is needed to give `hikari` the ability to unlock the screen when
55using the screen locker. Copy the appropriate `hikari-unlocker` file from the
56`pam.d` folder to `/usr/local/etc/pam.d` (or `/etc/pam.d` on most Linux
57systems).
58
59### Setting up the keyboard layout
60
61`hikari` gets its keyboard settings from `xkb` environment variables. To select
62a layout set the `XKB_DEFAULT_LAYOUT` to the desired value before staring
63`hikari`.
64
65```
66XKB_DEFAULT_LAYOUT "de(nodeadkeys),de"
67```
68
69## Building
70
71`hikari` currently only works on FreeBSD and Linux. This will likely change in
72the future when more systems adopt Wayland. When building directly from the
73repository, breaking changes might be encountered. These are documented in the
74`UPDATING` file which should be consulted before updating to a newer build.
75
76### Dependencies
77
78* wlroots
79* pango
80* cairo
81* libinput
82* xkbcommon
83* pixman
84* libucl
85* evdev-proto
86* epoll-shim (FreeBSD)
87* XWayland (optional, runtime dependency)
88
89### Compiling and Installing
90
91The build process will produce two binaries `hikari` and `hikari-unlocker`. The
92latter one is used to check credentials for unlocking the screen. Both need to
93be installed with root setuid in your `PATH`.
94
95`hikari` can be configured via `$XDG_CONFIG_HOME/hikari/hikari.conf`, the
96default configuration can be found under `$PREFIX/etc/hikari/hikari.conf`
97(depending on the value of `PREFIX` that was specified during the installation).
98
99The default configuration expects your default terminal emulator to be specified
100in the `$TERMINAL` environment variable.
101
102The installation destination can be configured by setting `PREFIX` (default is
103`/usr/local` and does not need to be given explicitly). If you want to install
104`hikari` into a directory other than `/usr/local` you always should state the
105`PREFIX` when issuing `make`, since this information is also used to specify
106where `hikari` can find the default configuration on your system and is needed
107during the compilation process. To override installation paths for `etc` specify
108`ETC_PREFIX`.
109
110#### Building on FreeBSD
111
112Simply run `make`. The installation destination can be configured by setting
113`PREFIX` (default is `/usr/local` and does not need to be given explicitly).
114
115```
116make
117```
118
119`uninstall` requires the same values for prefixes.
120
121#### Building on Linux
122
123On Linux `bmake` is required which needs to be run like so:
124
125```
126bmake WITH_POSIX_C_SOURCE=YES
127```
128
129The installation destination can be configured by
130setting`PREFIX` (default is `/usr/local` and does not need to be given
131explicitly).
132
133```
134bmake PREFIX=/usr/local install
135```
136
137`uninstall` requires the same values for prefixes.
138
139### Building with all features enabled
140
141The following sections explain how to enabled features on an individual basis.
142However, to enable every feature the build system offers the `WITH_ALL` flag.
143
144```
145make WITH_ALL=YES
146```
147
148#### Building with XWayland support
149
150`hikari` offers optional XWayland support which is enabled via setting
151`WITH_XWAYLAND`.
152
153```
154make WITH_XWAYLAND=YES
155```
156
157#### Building with screencopy support
158
159Screencopy support allows tools like `grim` to work with `hikari`, it also
160allows applications to copy the desktop content. This is disabled by default
161and can be added by setting `WITH_SCREENCOPY`.
162
163```
164make WITH_SCREENCOPY=YES
165```
166
167#### Building with gammacontrol support
168
169Gamma control is needed for tools like `redshift`. This is disabled by default
170and can be enabled via setting `WITH_GAMMACONTROL`.
171
172```
173make WITH_GAMMACONTROL=YES
174```
175
176#### Building with layer-shell support
177
178Some applications that are used to build desktop components require
179`layer-shell`. Examples for this are `waybar`, `wofi` and `slurp`. To turn on
180`layer-shell` support compile with the `WITH_LAYERSHELL` option.
181
182```
183make WITH_LAYERSHELL=YES
184```
185
186#### Building with virtual input support
187
188Virtual input support is needed for applications like `wayvnc`.
189
190```
191make WITH_VIRTUAL_INPUT=YES
192```
193
194#### Building the manpage
195
196Building the `hikari` manpage requires [`pandoc`](http://pandoc.org/). To build
197the manpage just run `make VERSION=1.0.0 doc`, where `VERSION` is the version
198number that will be spliced into the manpage. The distribution tarball of
199`hikari` comes with a precompiled manpage removing the need for a `pandoc`
200installation.
201
202#### Installing without SUID
203
204`hikari` requires root privileges during startup on BSD systems to initialize
205the `wlroots` backend, those are dropped as soon as possible. If you don't
206happen to need this you can prevent installation from setting this bit by
207issuing `WITHOUT_SUID`. (SUID is still set for `hikari-unlocker` to allow
208communication with PAM, which is required for password authentication)
209
210```
211make WITHOUT_SUID=YES install
212```
213
214## Community
215
216The `hikari` community gears to be inclusive and welcoming to everyone, this is
217why we chose to adhere to the [Geekfeminism Code of
218Conduct](https://hikari.acmelabs.space/coc.html).
219
220If you care to be a part of our community, please join our Matrix chat at
221`#hikari:acmelabs.space` and/or subscribe to our mailing list by sending a mail
222to `hikari+subscribe@acmelabs.space`.
223
224## Contributing
225
226Please make sure you use `clang-format` with the accompanying `.clang-format`
227configuration before submitting any patches.
228