# boatette/aion architecture

> Architecture diagram of the GitHub repository boatette/aion, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/boatette/aion
- Repository: https://github.com/boatette/aion

## Overview

aion is a Zig/wlroots Wayland compositor whose main workflow is starting a session, managing Wayland clients across tags and monitors, and arranging windows in a horizontally scrolling column layout. The README also documents configuration, input bindings and gestures, a status bar, launcher/session menus, and locking. The tree identifies the implementation files, but only src/c.h was excerpted; dashed, unverified links indicate likely runtime relationships rather than inspected calls.

Main entry points: [`src/Server.zig`](https://github.com/boatette/aion/blob/master/src/Server.zig) (Wayland server), [`src/main.zig`](https://github.com/boatette/aion/blob/master/src/main.zig) (Compositor entry), [`src/Client.zig`](https://github.com/boatette/aion/blob/master/src/Client.zig) (Client management), [`src/input.zig`](https://github.com/boatette/aion/blob/master/src/input.zig) (Input handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Compositor runtime"]
  node_main["Compositor entry<br/>[main.zig]"]
  node_server["Wayland server<br/>[Server.zig]"]
  node_config["Compiled config<br/>[config.zig]"]
end

subgraph group_windows["Windows and layout"]
  node_client["Client management<br/>[Client.zig]"]
  node_monitor["Monitor management<br/>[Monitor.zig]"]
  node_layer["Layer surfaces<br/>[LayerSurface.zig]"]
  node_scroll["Scrolling layout<br/>[scroll.zig]"]
end

subgraph group_interaction["Input and actions"]
  node_input["Input handling<br/>[input.zig]"]
  node_actions["Window actions<br/>[actions.zig]"]
end

subgraph group_services["Compositor services"]
  node_bar["Status bar<br/>[Bar.zig]"]
  node_menu["Launcher and menus<br/>[menu.zig]"]
  node_lock["Session lock<br/>[lock.zig]"]
end

node_user(("User"))
node_wlroots["wlroots"]
node_clients["Wayland clients"]
node_status["Status command"]

node_user -.->|"starts session"| node_main
node_main -.->|"starts compositor"| node_server
node_server -.->|"uses"| node_wlroots
node_clients -.->|"connects to"| node_server
node_server -.->|"manages clients"| node_client
node_server -.->|"manages monitors"| node_monitor
node_server -.->|"handles surfaces"| node_layer
node_client -.->|"uses layout"| node_scroll
node_user -.->|"provides input"| node_input
node_input -.->|"dispatches actions"| node_actions
node_main -.->|"uses settings"| node_config
node_server -.->|"provides bar"| node_bar
node_bar -.->|"reads status"| node_status
node_actions -.->|"opens menus"| node_menu
node_server -.->|"supports locking"| node_lock

click node_main "https://github.com/boatette/aion/blob/master/src/main.zig"
click node_server "https://github.com/boatette/aion/blob/master/src/Server.zig"
click node_config "https://github.com/boatette/aion/blob/master/src/config.zig"
click node_client "https://github.com/boatette/aion/blob/master/src/Client.zig"
click node_monitor "https://github.com/boatette/aion/blob/master/src/Monitor.zig"
click node_layer "https://github.com/boatette/aion/blob/master/src/LayerSurface.zig"
click node_scroll "https://github.com/boatette/aion/blob/master/src/scroll.zig"
click node_input "https://github.com/boatette/aion/blob/master/src/input.zig"
click node_actions "https://github.com/boatette/aion/blob/master/src/actions.zig"
click node_bar "https://github.com/boatette/aion/blob/master/src/Bar.zig"
click node_menu "https://github.com/boatette/aion/blob/master/src/menu.zig"
click node_lock "https://github.com/boatette/aion/blob/master/src/lock.zig"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_server,node_config,node_user,node_clients toneBlue
class node_client,node_monitor,node_layer,node_scroll toneAmber
class node_input,node_actions toneMint
class node_bar,node_menu,node_lock toneRose
class node_wlroots,node_status toneIndigo
```

## Components

### Compositor runtime

- [Compositor entry](https://github.com/boatette/aion/blob/master/src/main.zig): `src/main.zig`
- [Wayland server](https://github.com/boatette/aion/blob/master/src/Server.zig): `src/Server.zig`
- [Compiled config](https://github.com/boatette/aion/blob/master/src/config.zig): `src/config.zig`

### Windows and layout

- [Client management](https://github.com/boatette/aion/blob/master/src/Client.zig): `src/Client.zig`
- [Monitor management](https://github.com/boatette/aion/blob/master/src/Monitor.zig): `src/Monitor.zig`
- [Layer surfaces](https://github.com/boatette/aion/blob/master/src/LayerSurface.zig): `src/LayerSurface.zig`
- [Scrolling layout](https://github.com/boatette/aion/blob/master/src/scroll.zig): `src/scroll.zig`

### Input and actions

- [Input handling](https://github.com/boatette/aion/blob/master/src/input.zig): `src/input.zig`
- [Window actions](https://github.com/boatette/aion/blob/master/src/actions.zig): `src/actions.zig`

### Compositor services

- [Status bar](https://github.com/boatette/aion/blob/master/src/Bar.zig): `src/Bar.zig`
- [Launcher and menus](https://github.com/boatette/aion/blob/master/src/menu.zig): `src/menu.zig`
- [Session lock](https://github.com/boatette/aion/blob/master/src/lock.zig): `src/lock.zig`

### Other components

- **User**
- **wlroots**
- **Wayland clients**
- **Status command**

## Connections

- User → Compositor entry: starts session (evidence: `README.md`)
- Compositor entry → Wayland server: starts compositor
- Wayland server → wlroots: uses (evidence: `README.md`)
- Wayland clients → Wayland server: connects to
- Wayland server → Client management: manages clients
- Wayland server → Monitor management: manages monitors
- Wayland server → Layer surfaces: handles surfaces
- Client management → Scrolling layout: uses layout (evidence: `README.md`)
- User → Input handling: provides input
- Input handling → Window actions: dispatches actions
- Compositor entry → Compiled config: uses settings (evidence: `README.md`)
- Wayland server → Status bar: provides bar (evidence: `README.md`)
- Status bar → Status command: reads status (evidence: `README.md`)
- Window actions → Launcher and menus: opens menus (evidence: `README.md`)
- Wayland server → Session lock: supports locking
