# hyprwm/hyprland architecture

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

- Interactive diagram: https://gitdiagram.com/hyprwm/hyprland
- Repository: https://github.com/hyprwm/hyprland

## Overview

Hyprland is an independent Wayland compositor. Its principal workflow handles device input and keybinds, manages windows and workspaces through layout and rule systems, then renders desktop output to monitors. Configuration and IPC provide customization and control; plugins and the built-in plugin manager extend the compositor. The tree also contains hyprctl and hyprtester utilities. Some connections below are documented capabilities or inferred from module structure rather than shown call sites; those are marked dashed with no evidence path.

Main entry points: [`src/render/Renderer.hpp`](https://github.com/hyprwm/hyprland/blob/main/src/render/Renderer.hpp) (Rendering), [`src/managers/input/InputManager.cpp`](https://github.com/hyprwm/hyprland/blob/main/src/managers/input/InputManager.cpp) (Input manager), [`src/main.cpp`](https://github.com/hyprwm/hyprland/blob/main/src/main.cpp) (Compositor entry), [`src/layout/LayoutManager.cpp`](https://github.com/hyprwm/hyprland/blob/main/src/layout/LayoutManager.cpp) (Layout algorithms)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Compositor runtime"]
  node_main["Compositor entry<br/>[main.cpp]"]
  node_compositor["Compositor core<br/>[Compositor.hpp]"]
end

subgraph group_desktop["Desktop management"]
  node_layout["Layout algorithms<br/>[LayoutManager.cpp]"]
  node_placement["Workspace placement"]
  node_rules["Window and layer rules<br/>[Engine.cpp]"]
  node_windows["Window state<br/>[Window.cpp]"]
end

subgraph group_io["Input and output"]
  node_keybinds["Keybind manager<br/>[Manager.cpp]"]
  node_input["Input manager<br/>[InputManager.cpp]"]
  node_seat["Wayland seat<br/>[SeatManager.hpp]"]
  node_monitor["Monitor management<br/>[Monitor.hpp]"]
  node_renderer["Rendering<br/>[Renderer.hpp]"]
  node_animation["Animations"]
end

subgraph group_control["Configuration and control"]
  node_config["Configuration<br/>[ConfigManager.cpp]"]
  node_configwatch["Config watcher<br/>[ConfigWatcher.cpp]"]
  node_lua["Lua customization<br/>[ConfigManager.cpp]"]
  node_ipc["Socket IPC<br/>[S1.cpp]"]
end

subgraph group_extensions["Extensions and tools"]
  node_pluginmgr["Plugin manager<br/>[PluginManager.cpp]"]
  node_hyprctl["Control client<br/>[main.cpp]"]
  node_tester["Protocol test clients"]
  node_plugins["Plugin support<br/>[main.cpp]"]
end

node_user(("Desktop user"))

node_user -.->|"starts session"| node_main
node_main -->|"initializes"| node_compositor
node_configwatch -.->|"reloads"| node_config
node_config -.->|"supports customization"| node_lua
node_user -.->|"sends commands"| node_ipc
node_hyprctl -.->|"controls over socket"| node_ipc
node_input -->|"dispatches input"| node_keybinds
node_input -.->|"forwards events"| node_seat
node_keybinds -->|"invokes actions"| node_layout
node_layout -.->|"arranges workspaces"| node_placement
node_placement -->|"assigns windows"| node_windows
node_rules -.->|"applies window rules"| node_windows
node_monitor -.->|"provides outputs"| node_renderer
node_renderer -->|"renders frames"| node_monitor
node_animation -->|"damages output"| node_renderer
node_pluginmgr -.->|"manages plugins"| node_plugins
node_tester -.->|"tests protocols"| node_compositor

click node_main "https://github.com/hyprwm/hyprland/blob/main/src/main.cpp"
click node_compositor "https://github.com/hyprwm/hyprland/blob/main/src/Compositor.hpp"
click node_config "https://github.com/hyprwm/hyprland/blob/main/src/config/ConfigManager.cpp"
click node_configwatch "https://github.com/hyprwm/hyprland/blob/main/src/config/shared/inotify/ConfigWatcher.cpp"
click node_lua "https://github.com/hyprwm/hyprland/blob/main/src/config/lua/ConfigManager.cpp"
click node_ipc "https://github.com/hyprwm/hyprland/blob/main/src/ipc/s1/S1.cpp"
click node_keybinds "https://github.com/hyprwm/hyprland/blob/main/src/keybinds/Manager.cpp"
click node_input "https://github.com/hyprwm/hyprland/blob/main/src/managers/input/InputManager.cpp"
click node_seat "https://github.com/hyprwm/hyprland/blob/main/src/managers/SeatManager.hpp"
click node_layout "https://github.com/hyprwm/hyprland/blob/main/src/layout/LayoutManager.cpp"
click node_placement "https://github.com/hyprwm/hyprland/blob/main/src/state/workspace/PlacementController.cpp"
click node_rules "https://github.com/hyprwm/hyprland/blob/main/src/desktop/rule/Engine.cpp"
click node_windows "https://github.com/hyprwm/hyprland/blob/main/src/desktop/view/window/Window.cpp"
click node_monitor "https://github.com/hyprwm/hyprland/blob/main/src/output/Monitor.hpp"
click node_renderer "https://github.com/hyprwm/hyprland/blob/main/src/render/Renderer.hpp"
click node_animation "https://github.com/hyprwm/hyprland/blob/main/src/animation/AnimationManager.cpp"
click node_pluginmgr "https://github.com/hyprwm/hyprland/blob/main/hyprpm/src/core/PluginManager.cpp"
click node_hyprctl "https://github.com/hyprwm/hyprland/blob/main/hyprctl/src/main.cpp"
click node_tester "https://github.com/hyprwm/hyprland/tree/main/hyprtester/clients"
click node_plugins "https://github.com/hyprwm/hyprland/blob/main/hyprtester/plugin/src/main.cpp"

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_compositor,node_user toneBlue
class node_layout,node_placement,node_rules,node_windows toneAmber
class node_keybinds,node_input,node_seat,node_monitor,node_renderer,node_animation toneMint
class node_config,node_configwatch,node_lua,node_ipc toneRose
class node_pluginmgr,node_hyprctl,node_tester,node_plugins toneIndigo
```

## Components

### Compositor runtime

- [Compositor entry](https://github.com/hyprwm/hyprland/blob/main/src/main.cpp): `src/main.cpp`
- [Compositor core](https://github.com/hyprwm/hyprland/blob/main/src/Compositor.hpp): `src/Compositor.hpp`

### Desktop management

- [Layout algorithms](https://github.com/hyprwm/hyprland/blob/main/src/layout/LayoutManager.cpp): `src/layout/LayoutManager.cpp`
- [Workspace placement](https://github.com/hyprwm/hyprland/blob/main/src/state/workspace/PlacementController.cpp): `src/state/workspace/PlacementController.cpp`
- [Window and layer rules](https://github.com/hyprwm/hyprland/blob/main/src/desktop/rule/Engine.cpp): `src/desktop/rule/Engine.cpp`
- [Window state](https://github.com/hyprwm/hyprland/blob/main/src/desktop/view/window/Window.cpp): `src/desktop/view/window/Window.cpp`

### Input and output

- [Keybind manager](https://github.com/hyprwm/hyprland/blob/main/src/keybinds/Manager.cpp): `src/keybinds/Manager.cpp`
- [Input manager](https://github.com/hyprwm/hyprland/blob/main/src/managers/input/InputManager.cpp): `src/managers/input/InputManager.cpp`
- [Wayland seat](https://github.com/hyprwm/hyprland/blob/main/src/managers/SeatManager.hpp): `src/managers/SeatManager.hpp`
- [Monitor management](https://github.com/hyprwm/hyprland/blob/main/src/output/Monitor.hpp): `src/output/Monitor.hpp`
- [Rendering](https://github.com/hyprwm/hyprland/blob/main/src/render/Renderer.hpp): `src/render/Renderer.hpp`
- [Animations](https://github.com/hyprwm/hyprland/blob/main/src/animation/AnimationManager.cpp): `src/animation/AnimationManager.cpp`

### Configuration and control

- [Configuration](https://github.com/hyprwm/hyprland/blob/main/src/config/ConfigManager.cpp): `src/config/ConfigManager.cpp`
- [Config watcher](https://github.com/hyprwm/hyprland/blob/main/src/config/shared/inotify/ConfigWatcher.cpp): `src/config/shared/inotify/ConfigWatcher.cpp`
- [Lua customization](https://github.com/hyprwm/hyprland/blob/main/src/config/lua/ConfigManager.cpp): `src/config/lua/ConfigManager.cpp`
- [Socket IPC](https://github.com/hyprwm/hyprland/blob/main/src/ipc/s1/S1.cpp): `src/ipc/s1/S1.cpp`

### Extensions and tools

- [Plugin manager](https://github.com/hyprwm/hyprland/blob/main/hyprpm/src/core/PluginManager.cpp): `hyprpm/src/core/PluginManager.cpp`
- [Control client](https://github.com/hyprwm/hyprland/blob/main/hyprctl/src/main.cpp): `hyprctl/src/main.cpp`
- [Protocol test clients](https://github.com/hyprwm/hyprland/tree/main/hyprtester/clients): `hyprtester/clients`
- [Plugin support](https://github.com/hyprwm/hyprland/blob/main/hyprtester/plugin/src/main.cpp): `hyprtester/plugin/src/main.cpp`

### Other components

- **Desktop user**

## Connections

- Desktop user → Compositor entry: starts session
- Compositor entry → Compositor core: initializes (evidence: `src/main.cpp`)
- Config watcher → Configuration: reloads
- Configuration → Lua customization: supports customization
- Desktop user → Socket IPC: sends commands
- Control client → Socket IPC: controls over socket
- Input manager → Keybind manager: dispatches input (evidence: `src/keybinds/Manager.cpp`)
- Input manager → Wayland seat: forwards events (evidence: `src/managers/input/InputManager.cpp`)
- Keybind manager → Layout algorithms: invokes actions (evidence: `src/keybinds/Manager.cpp`)
- Layout algorithms → Workspace placement: arranges workspaces
- Workspace placement → Window state: assigns windows (evidence: `src/state/workspace/PlacementController.cpp`)
- Window and layer rules → Window state: applies window rules
- Monitor management → Rendering: provides outputs (evidence: `src/render/Renderer.hpp`)
- Rendering → Monitor management: renders frames (evidence: `src/render/Renderer.hpp`)
- Animations → Rendering: damages output (evidence: `src/animation/AnimationManager.cpp`)
- Plugin manager → Plugin support: manages plugins
- Protocol test clients → Compositor core: tests protocols
