# Forge

Forge is the Liberux **Wayland compositor**, written in Rust on top of
[Smithay](https://github.com/Smithay/smithay). It is mobile-first (Librem 5 /
Liberux NEXX) but also runs as a regular desktop compositor.

Forge owns the display: KMS/DRM output and mode-setting, GLES rendering,
libinput input with touch/gesture handling, server-side decorations, XWayland,
and the wlroots/ext protocol surface the Crustace shell and apps render against.

## Features

- **Backends:** native KMS/DRM + GBM via udev (on-device), and an optional
  `winit` window backend for development on a desktop session.
- **Rendering:** GLES2 renderer with damage tracking; the KMS commit/vblank
  handling runs on a dedicated per-device thread, separate from rendering.
- **Input & gestures:** libinput, touch grabs, edge/corner gesture recognizer,
  app switcher and overview, hot-corner actions.
- **Window management:** tiling/stacking layouts, server-side decorations
  (rounded title bar per the figma) with a `csd_apps` allow-list so
  client-side-decorated apps are not double-decorated, XWayland integration.
- **System integration (D-Bus):** logind, polkit, MPRIS, GeoClue, night light /
  auto-brightness, idle monitor, GNOME-shell/display-config shims, the
  xdg-desktop-portal backend hooks, and an IPC server (`forge-ipc`) for CLI
  toggles.

## Building

Native build dependencies (libwayland, libinput, libudev, libgbm, libdrm,
libEGL/GLES, libxkbcommon, libseat, pixman, …) are needed. On Debian/Ubuntu the
project builds inside the `debian-forge` distrobox.

```bash
cargo build --release
```

## Running

On a TTY (real hardware), it picks the udev/KMS backend automatically:

```bash
forge
```

In a nested window for development (requires the `winit` feature):

```bash
forge --winit --size 480x900
```

Useful flags:

- `--exec <PATH>` — run this executable once the Wayland socket is up, instead
  of searching for an `initrc` in `~/.config/forge/` or `/etc/forge/`.
- `forge msg …` — send an IPC message to a running compositor (CLI toggles).

## Configuration

Forge reads `~/.config/forge/forge.toml` (see `src/config.rs` for the schema,
including the `decoration.csd_apps` list). A startup `initrc` may live in
`~/.config/forge/` or `/etc/forge/`.

## License

LGPL-2.1-only. See [LICENSE](LICENSE).
