Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git
README.md (2.9K)
1 # cce-fx
2
3 `cce-fx` is a standalone Wayland compositor and tiling window manager written in Rust,
4 built on **wlroots 0.20** (via FFI) with a vendored **scenefx** for blur and
5 rounded-corner scene effects. It began as a Rust rewrite of the
6 [river](https://isaacfreund.com/software/river) compositor and remains GPL-3.0 licensed.
7
8 This crate is the compositor. It lives inside the larger `cce` Cargo workspace (root at
9 the parent directory), alongside client apps such as `cce-status-interface`,
10 `cce-system-interface`, and other `cce-*` siblings that connect to it over its sockets.
11
12 ## Binaries
13
14 - **`cce-fx`** (installed and symlinked as `cce`) — the compositor server. Running it
15 starts the monolithic compositor and window manager.
16 - **`ccectl`** — the control client. It talks to a running server over the control
17 socket. Run `ccectl` with no arguments to list the available commands (layout, view,
18 mode, viewport, pointer/key injection, bind, spawn, notify, reload, exit, …).
19
20 ## Build & install
21
22 ```sh
23 make build # cargo build --release
24 make run # cargo run --bin cce-fx
25 make install # build, then install to ~/.local/bin
26 make clean # cargo clean
27 ```
28
29 `make install` places `cce-fx` (symlinked as `cce`), `ccectl`, the `scripts/*` menu
30 helpers, and `gpu-watcher` (plus its systemd user service) into `~/.local/bin`.
31
32 ### Build requirements
33
34 The build (`build.rs`) compiles the vendored `scenefx/` with **meson**/**ninja** on
35 first run, generates Wayland protocol code with **wayland-scanner**, and binds wlroots
36 via **bindgen**. It requires these system packages (found through `pkg-config`):
37 `wlroots-0.20`, `wayland-server`, `xkbcommon`, `pixman-1`, `libinput`, `libevdev`, and
38 the GL/DRM stack (`GLESv2`, `EGL`, `drm`, `gbm`, `lcms2`), plus the system
39 `wayland-protocols` XML definitions.
40
41 ## Configuration
42
43 On startup the server loads **`$XDG_CONFIG_HOME/cce/config.kdl`** (default
44 `~/.config/cce/config.kdl`), merging an adjacent `input.kdl` for key bindings and input
45 settings. The config format is [KDL](https://kdl.dev). A startup script at
46 `~/.config/cce/init` is run via `sh -c`. Window layout state is persisted to
47 `~/.local/state/cce/state.json` on exit and restored on the next start.
48
49 Configuration can also be changed live over the control socket with `ccectl`.
50
51 Idle timeouts go in an `idle { }` block: `display_off` and `sleep` are seconds of
52 no input (0, the default, disables one), and `sleep_command` overrides the
53 default `systemctl suspend`:
54
55 ```kdl
56 idle {
57 display_off 600
58 sleep 1800
59 }
60 ```
61
62 Any pointer or key input wakes the darkened outputs and restarts both countdowns; an
63 idle-inhibitor held by a mapped surface (a playing video) pauses them. `ccectl idle`
64 reports the state, and `ccectl idle timeouts <display_off> <sleep>` sets them live.
65
66 ## Development
67
68 See [CLAUDE.md](CLAUDE.md) for a detailed tour of the architecture, the FFI
69 conventions, the `build.rs` pipeline, and the IPC/status socket protocols.