# patrickmeerssche/dell-galien-controller architecture

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

- Interactive diagram: https://gitdiagram.com/patrickmeerssche/dell-galien-controller
- Repository: https://github.com/patrickmeerssche/dell-galien-controller

## Overview

Dell GAlien Controller is a Linux GUI for keyboard lighting and Dell laptop performance controls. The user changes settings in the app; it applies lighting over USB, sends privileged power-control requests to a root helper, and displays live system readings. Separate branches cover NVIDIA PowerMizer, CPU governor and Ubuntu power profiles, tray behavior, and saved preferences. Model detection is an install-time workflow, not a runtime hardware probe. The graph reflects README capabilities and indexed module references; some app dispatch details were not sampled, so those links rely on documented behavior.

Main entry points: [`crates/app/src/main.rs`](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/main.rs) (App state and dispatch), [`crates/helper/src/main.rs`](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/helper/src/main.rs) (Root helper), [`crates/app/src/sensors.rs`](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/sensors.rs) (System sampler), [`crates/app/src/tuning.rs`](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/tuning.rs) (Performance tuning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gui["Desktop app"]
  node_app["App state and dispatch<br/>[main.rs]"]
  node_view["Control pages<br/>[view.rs]"]
  node_settings["Preferences<br/>[settings.rs]"]
  node_tray["Tray controls<br/>[tray.rs]"]
end

subgraph group_hardware["Device controls"]
  node_hid["Keyboard lighting<br/>[hid.rs]"]
  node_acpi["ACPI firmware interface"]
  node_keyboard["Laptop keyboard controller"]
end

subgraph group_telemetry["Monitoring and tuning"]
  node_sensors["System sampler<br/>[sensors.rs]"]
  node_sysfs["Linux sensor sources"]
  node_nvidia["NVIDIA telemetry"]
  node_tuning["Performance tuning<br/>[tuning.rs]"]
  node_power_profiles["Ubuntu power profiles"]
end

subgraph group_privileged["Helper and protocol"]
  node_client["Helper client<br/>[client.rs]"]
  node_proto["Request protocol<br/>[lib.rs]"]
  node_helper["Root helper<br/>[main.rs]"]
end

subgraph group_models["Model setup"]
  node_models["Supported model table<br/>[model.rs]"]
  node_detect["Install-time detection<br/>[detect.rs]"]
  node_model_config[("Installed model config")]
end

node_user(("Laptop user"))

node_user -->|"uses controls"| node_view
node_app -->|"renders"| node_view
node_app -->|"loads and updates"| node_settings
node_app -->|"starts tray"| node_tray
node_app -.->|"applies lighting"| node_hid
node_app -->|"sends controls"| node_client
node_app -->|"samples readings"| node_sensors
node_app -->|"reads tuning state"| node_tuning
node_hid -->|"controls over USB"| node_keyboard
node_sensors -->|"requests snapshot"| node_client
node_sensors -->|"reads metrics"| node_sysfs
node_sensors -->|"samples GPU"| node_nvidia
node_client -->|"sends socket requests"| node_helper
node_client -->|"encodes requests"| node_proto
node_helper -->|"decodes requests"| node_proto
node_helper -->|"executes firmware calls"| node_acpi
node_helper -->|"checks installed model"| node_models
node_helper -.->|"sets privileged tuning"| node_tuning
node_tuning -->|"sets PowerMizer"| node_nvidia
node_tuning -->|"sets power profile"| node_power_profiles
node_detect -->|"selects model"| node_models
node_detect -->|"writes model choice"| node_model_config
node_helper -->|"runs install detection"| node_detect
node_models -->|"loads saved choice"| node_model_config

click node_app "https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/main.rs"
click node_view "https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/view.rs"
click node_settings "https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/settings.rs"
click node_tray "https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/tray.rs"
click node_hid "https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/hid.rs"
click node_client "https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/client.rs"
click node_proto "https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/proto/src/lib.rs"
click node_helper "https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/helper/src/main.rs"
click node_models "https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/proto/src/model.rs"
click node_detect "https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/helper/src/detect.rs"
click node_sensors "https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/sensors.rs"
click node_tuning "https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/tuning.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_app,node_view,node_settings,node_tray,node_user toneBlue
class node_hid,node_acpi,node_keyboard toneAmber
class node_sensors,node_sysfs,node_nvidia,node_tuning,node_power_profiles toneMint
class node_client,node_proto,node_helper toneRose
class node_models,node_detect,node_model_config toneIndigo
```

## Components

### Desktop app

- [App state and dispatch](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/main.rs): `crates/app/src/main.rs`
- [Control pages](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/view.rs): `crates/app/src/view.rs`
- [Preferences](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/settings.rs): `crates/app/src/settings.rs`
- [Tray controls](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/tray.rs): `crates/app/src/tray.rs`

### Device controls

- [Keyboard lighting](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/hid.rs): `crates/app/src/hid.rs`
- **ACPI firmware interface**
- **Laptop keyboard controller**

### Monitoring and tuning

- [System sampler](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/sensors.rs): `crates/app/src/sensors.rs`
- **Linux sensor sources**
- **NVIDIA telemetry**
- [Performance tuning](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/tuning.rs): `crates/app/src/tuning.rs`
- **Ubuntu power profiles**

### Helper and protocol

- [Helper client](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/app/src/client.rs): `crates/app/src/client.rs`
- [Request protocol](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/proto/src/lib.rs): `crates/proto/src/lib.rs`
- [Root helper](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/helper/src/main.rs): `crates/helper/src/main.rs`

### Model setup

- [Supported model table](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/proto/src/model.rs): `crates/proto/src/model.rs`
- [Install-time detection](https://github.com/patrickmeerssche/dell-galien-controller/blob/main/crates/helper/src/detect.rs): `crates/helper/src/detect.rs`
- **Installed model config**

### Other components

- **Laptop user**

## Connections

- Laptop user → Control pages: uses controls (evidence: `README.md`)
- App state and dispatch → Control pages: renders (evidence: `crates/app/src/main.rs`)
- App state and dispatch → Preferences: loads and updates (evidence: `crates/app/src/main.rs`)
- App state and dispatch → Tray controls: starts tray (evidence: `crates/app/src/main.rs`)
- App state and dispatch → Keyboard lighting: applies lighting (evidence: `README.md`)
- App state and dispatch → Helper client: sends controls (evidence: `crates/app/src/main.rs`)
- App state and dispatch → System sampler: samples readings (evidence: `crates/app/src/main.rs`)
- App state and dispatch → Performance tuning: reads tuning state (evidence: `crates/app/src/main.rs`)
- Keyboard lighting → Laptop keyboard controller: controls over USB (evidence: `crates/app/src/hid.rs`)
- System sampler → Helper client: requests snapshot (evidence: `crates/app/src/sensors.rs`)
- System sampler → Linux sensor sources: reads metrics (evidence: `crates/app/src/sensors.rs`)
- System sampler → NVIDIA telemetry: samples GPU (evidence: `crates/app/src/sensors.rs`)
- Helper client → Root helper: sends socket requests (evidence: `README.md`)
- Helper client → Request protocol: encodes requests (evidence: `crates/app/src/client.rs`)
- Root helper → Request protocol: decodes requests (evidence: `crates/helper/src/main.rs`)
- Root helper → ACPI firmware interface: executes firmware calls (evidence: `crates/helper/src/main.rs`)
- Root helper → Supported model table: checks installed model (evidence: `crates/helper/src/main.rs`)
- Root helper → Performance tuning: sets privileged tuning (evidence: `README.md`)
- Performance tuning → NVIDIA telemetry: sets PowerMizer (evidence: `crates/app/src/tuning.rs`)
- Performance tuning → Ubuntu power profiles: sets power profile (evidence: `crates/app/src/tuning.rs`)
- Install-time detection → Supported model table: selects model (evidence: `crates/helper/src/detect.rs`)
- Install-time detection → Installed model config: writes model choice (evidence: `crates/helper/src/detect.rs`)
- Root helper → Install-time detection: runs install detection (evidence: `crates/helper/src/main.rs`)
- Supported model table → Installed model config: loads saved choice (evidence: `crates/proto/src/model.rs`)
