# shark-empire/mitos-gui architecture

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

- Interactive diagram: https://gitdiagram.com/shark-empire/mitos-gui
- Repository: https://github.com/shark-empire/mitos-gui

## Overview

MITOS GUI is a Rust Wayland compositor and desktop shell. Its main workflow is: users and Wayland clients provide input and surfaces; the compositor manages outputs, workspaces, and windows; the shell and renderer compose the desktop; and the backend presents frames. The graph also captures documented configuration, launching, notifications, screenshots, accessibility, and session-authentication capabilities. The README documents several subsystems whose implementation was not sampled; their paths use the existing source files named there, and uncertain internal wiring is omitted.

Main entry points: [`src/main.rs`](https://github.com/shark-empire/mitos-gui/blob/main/src/main.rs) (Compositor loop), [`src/keyboard.rs`](https://github.com/shark-empire/mitos-gui/blob/main/src/keyboard.rs) (Keyboard actions), [`src/session_ipc.rs`](https://github.com/shark-empire/mitos-gui/blob/main/src/session_ipc.rs) (Session IPC), [`src/input.rs`](https://github.com/shark-empire/mitos-gui/blob/main/src/input.rs) (Input routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Compositor Core"]
  node_main["Compositor loop<br/>[main.rs]"]
  node_state["Compositor state<br/>[state.rs]"]
  node_wm["Window manager<br/>[wm.rs]"]
end

subgraph group_shell["Desktop Shell"]
  node_desktop["Shell layout<br/>[desktop.rs]"]
  node_shellinteraction["App launcher"]
  node_config["Live config watcher<br/>[config_watcher.rs]"]
  node_theme["Glass theme<br/>[theme.rs]"]
end

subgraph group_hardware["Graphics and Input"]
  node_backend["DRM backend<br/>[drm_backend.rs]"]
  node_renderer["Desktop renderer<br/>[renderer.rs]"]
  node_input["Input routing<br/>[input.rs]"]
  node_keyboard["Keyboard actions<br/>[keyboard.rs]"]
  node_gestures["Touch gestures<br/>[gestures.rs]"]
end

subgraph group_services["System Services"]
  node_sessionipc["Session IPC<br/>[session_ipc.rs]"]
  node_auth["Auth prompts<br/>[auth.rs]"]
  node_notifications["Notifications<br/>[notifications.rs]"]
  node_notify["Service readiness<br/>[notify.rs]"]
  node_screenshot["Screenshots<br/>[screenshot.rs]"]
end

subgraph group_access["Accessibility"]
  node_atspi["AT-SPI provider<br/>[atspi.rs]"]
end

node_user(("Desktop user"))
node_clients(("Wayland clients"))
node_sessiond(("mitos-session"))
node_screenreader(("Screen reader"))

node_user -->|"provides input"| node_input
node_clients -->|"submit surfaces"| node_main
node_main -->|"updates"| node_state
node_main -->|"runs backend"| node_backend
node_backend -->|"presents frames"| node_renderer
node_main -->|"renders scene"| node_renderer
node_main -->|"dispatches requests"| node_wm
node_input -->|"routes keys"| node_keyboard
node_input -->|"routes gestures"| node_gestures
node_keyboard -->|"controls windows"| node_wm
node_keyboard -->|"launches apps"| node_shellinteraction
node_keyboard -->|"requests lock"| node_sessionipc
node_main -->|"uses layout"| node_desktop
node_main -->|"watches config"| node_config
node_config -->|"updates settings"| node_state
node_renderer -->|"reads theme"| node_theme
node_main -->|"polls messages"| node_sessionipc
node_sessionipc -->|"exchanges IPC"| node_sessiond
node_main -->|"updates prompts"| node_auth
node_sessionipc -->|"delivers auth events"| node_auth
node_main -->|"dispatches notifications"| node_notifications
node_main -->|"handles capture"| node_screenshot
node_main -->|"signals readiness"| node_notify
node_main -->|"syncs shell state"| node_atspi
node_atspi -->|"exposes accessibility"| node_screenreader

click node_main "https://github.com/shark-empire/mitos-gui/blob/main/src/main.rs"
click node_state "https://github.com/shark-empire/mitos-gui/blob/main/src/state.rs"
click node_wm "https://github.com/shark-empire/mitos-gui/blob/main/src/wm.rs"
click node_backend "https://github.com/shark-empire/mitos-gui/blob/main/src/drm_backend.rs"
click node_renderer "https://github.com/shark-empire/mitos-gui/blob/main/src/renderer.rs"
click node_input "https://github.com/shark-empire/mitos-gui/blob/main/src/input.rs"
click node_keyboard "https://github.com/shark-empire/mitos-gui/blob/main/src/keyboard.rs"
click node_gestures "https://github.com/shark-empire/mitos-gui/blob/main/src/gestures.rs"
click node_desktop "https://github.com/shark-empire/mitos-gui/blob/main/src/desktop.rs"
click node_shellinteraction "https://github.com/shark-empire/mitos-gui/blob/main/src/shell_interaction.rs"
click node_config "https://github.com/shark-empire/mitos-gui/blob/main/src/config_watcher.rs"
click node_theme "https://github.com/shark-empire/mitos-gui/blob/main/src/theme.rs"
click node_sessionipc "https://github.com/shark-empire/mitos-gui/blob/main/src/session_ipc.rs"
click node_auth "https://github.com/shark-empire/mitos-gui/blob/main/src/auth.rs"
click node_notifications "https://github.com/shark-empire/mitos-gui/blob/main/src/notifications.rs"
click node_notify "https://github.com/shark-empire/mitos-gui/blob/main/src/notify.rs"
click node_screenshot "https://github.com/shark-empire/mitos-gui/blob/main/src/screenshot.rs"
click node_atspi "https://github.com/shark-empire/mitos-gui/blob/main/src/atspi.rs"

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_state,node_wm,node_user,node_clients,node_screenreader toneBlue
class node_desktop,node_shellinteraction,node_config,node_theme toneAmber
class node_backend,node_renderer,node_input,node_keyboard,node_gestures toneMint
class node_sessionipc,node_auth,node_notifications,node_notify,node_screenshot toneRose
class node_atspi,node_sessiond toneIndigo
```

## Components

### Compositor Core

- [Compositor loop](https://github.com/shark-empire/mitos-gui/blob/main/src/main.rs): `src/main.rs`
- [Compositor state](https://github.com/shark-empire/mitos-gui/blob/main/src/state.rs): `src/state.rs`
- [Window manager](https://github.com/shark-empire/mitos-gui/blob/main/src/wm.rs): `src/wm.rs`

### Desktop Shell

- [Shell layout](https://github.com/shark-empire/mitos-gui/blob/main/src/desktop.rs): `src/desktop.rs`
- [App launcher](https://github.com/shark-empire/mitos-gui/blob/main/src/shell_interaction.rs): `src/shell_interaction.rs`
- [Live config watcher](https://github.com/shark-empire/mitos-gui/blob/main/src/config_watcher.rs): `src/config_watcher.rs`
- [Glass theme](https://github.com/shark-empire/mitos-gui/blob/main/src/theme.rs): `src/theme.rs`

### Graphics and Input

- [DRM backend](https://github.com/shark-empire/mitos-gui/blob/main/src/drm_backend.rs): `src/drm_backend.rs`
- [Desktop renderer](https://github.com/shark-empire/mitos-gui/blob/main/src/renderer.rs): `src/renderer.rs`
- [Input routing](https://github.com/shark-empire/mitos-gui/blob/main/src/input.rs): `src/input.rs`
- [Keyboard actions](https://github.com/shark-empire/mitos-gui/blob/main/src/keyboard.rs): `src/keyboard.rs`
- [Touch gestures](https://github.com/shark-empire/mitos-gui/blob/main/src/gestures.rs): `src/gestures.rs`

### System Services

- [Session IPC](https://github.com/shark-empire/mitos-gui/blob/main/src/session_ipc.rs): `src/session_ipc.rs`
- [Auth prompts](https://github.com/shark-empire/mitos-gui/blob/main/src/auth.rs): `src/auth.rs`
- [Notifications](https://github.com/shark-empire/mitos-gui/blob/main/src/notifications.rs): `src/notifications.rs`
- [Service readiness](https://github.com/shark-empire/mitos-gui/blob/main/src/notify.rs): `src/notify.rs`
- [Screenshots](https://github.com/shark-empire/mitos-gui/blob/main/src/screenshot.rs): `src/screenshot.rs`

### Accessibility

- [AT-SPI provider](https://github.com/shark-empire/mitos-gui/blob/main/src/atspi.rs): `src/atspi.rs`

### Other components

- **Desktop user**
- **Wayland clients**
- **mitos-session**
- **Screen reader**

## Connections

- Desktop user → Input routing: provides input
- Wayland clients → Compositor loop: submit surfaces
- Compositor loop → Compositor state: updates
- Compositor loop → DRM backend: runs backend
- DRM backend → Desktop renderer: presents frames
- Compositor loop → Desktop renderer: renders scene
- Compositor loop → Window manager: dispatches requests
- Input routing → Keyboard actions: routes keys
- Input routing → Touch gestures: routes gestures
- Keyboard actions → Window manager: controls windows
- Keyboard actions → App launcher: launches apps
- Keyboard actions → Session IPC: requests lock
- Compositor loop → Shell layout: uses layout
- Compositor loop → Live config watcher: watches config
- Live config watcher → Compositor state: updates settings
- Desktop renderer → Glass theme: reads theme
- Compositor loop → Session IPC: polls messages
- Session IPC → mitos-session: exchanges IPC
- Compositor loop → Auth prompts: updates prompts
- Session IPC → Auth prompts: delivers auth events
- Compositor loop → Notifications: dispatches notifications
- Compositor loop → Screenshots: handles capture
- Compositor loop → Service readiness: signals readiness
- Compositor loop → AT-SPI provider: syncs shell state
- AT-SPI provider → Screen reader: exposes accessibility
