# jackockzuo/omen-rs architecture

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

- Interactive diagram: https://gitdiagram.com/jackockzuo/omen-rs
- Repository: https://github.com/jackockzuo/omen-rs

## Overview

omen-rs is a Linux Rust CLI and daemon for controlling HP OMEN BIOS/EC features. Users issue `omen` commands directly or, for supported read-only queries, through `omend` over a Unix socket. The daemon also periodically reapplies power profiles and controls fan speed from CPU temperature and a curve or manual mode. Feature commands use capability checks and hardware access layers; the README documents additional command capabilities whose individual implementations were not sampled, so those links are shown at the feature-module level.

Main entry points: [`src/bin/omend.rs`](https://github.com/jackockzuo/omen-rs/blob/main/src/bin/omend.rs) (omend daemon), [`src/commands/mod.rs`](https://github.com/jackockzuo/omen-rs/blob/main/src/commands/mod.rs) (Command registry), [`src/transport.rs`](https://github.com/jackockzuo/omen-rs/blob/main/src/transport.rs) (ACPI transport), [`src/main.rs`](https://github.com/jackockzuo/omen-rs/blob/main/src/main.rs) (omen CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_cli["omen CLI<br/>[main.rs]"]
  node_client["Socket client<br/>[client.rs]"]
end

subgraph group_daemon["Daemon services"]
  node_omend["omend daemon<br/>[omend.rs]"]
  node_fanmode["Fan mode file"]
  node_curve["Fan curve<br/>[fan_curve.rs]"]
end

subgraph group_features["OMEN controls"]
  node_commands["Command registry<br/>[mod.rs]"]
  node_capability["Capability gate<br/>[capability.rs]"]
  node_powerprofile["Power profiles<br/>[power_profile.rs]"]
  node_fan["Fan control<br/>[fan.rs]"]
  node_sensors["Sensors<br/>[sensors.rs]"]
  node_gpu["GPU power<br/>[gpu.rs]"]
  node_battery["Battery care<br/>[battery.rs]"]
  node_othercommands["Other controls"]
end

subgraph group_hardware["Hardware access"]
  node_transport["ACPI transport<br/>[transport.rs]"]
  node_ec["EC access<br/>[ec.rs]"]
end

subgraph group_protocol["Protocol"]
  node_protocol["WMAA protocol"]
  node_secu["SECU encoding<br/>[secu.rs]"]
  node_decode["Response decoding<br/>[decode.rs]"]
end

node_user(("User"))
node_gui["Noctalia plugin<br/>[service.luau]"]
node_acpi["ACPI call interface"]
node_ecsys["EC debugfs"]
node_profilefs["Platform profile"]
node_hwmon["CPU hwmon"]

node_user -->|"runs commands"| node_cli
node_gui -->|"selects mode"| node_fanmode
node_cli -->|"dispatches controls"| node_commands
node_cli -->|"routes read queries"| node_client
node_client -->|"sends socket requests"| node_omend
node_omend -->|"dispatches read commands"| node_commands
node_omend -->|"reapplies profile"| node_powerprofile
node_omend -->|"reads mode"| node_fanmode
node_omend -->|"reads CPU temperature"| node_sensors
node_omend -->|"evaluates temperature"| node_curve
node_omend -->|"sets fan speed"| node_fan
node_commands -->|"checks capabilities"| node_capability
node_capability -->|"queries hardware"| node_transport
node_commands -->|"dispatches fan operations"| node_fan
node_commands -->|"dispatches GPU operations"| node_gpu
node_commands -->|"dispatches battery operations"| node_battery
node_commands -->|"dispatches other features"| node_othercommands
node_fan -->|"issues WMAA calls"| node_transport
node_gpu -->|"issues WMAA calls"| node_transport
node_sensors -->|"reads WMAA sensors"| node_transport
node_sensors -->|"reads CPU temperatures"| node_hwmon
node_powerprofile -->|"reads and writes EC"| node_ec
node_powerprofile -->|"reads and writes profile"| node_profilefs
node_ec -->|"accesses registers"| node_ecsys
node_transport -->|"formats and decodes"| node_protocol
node_protocol -->|"builds ACPI payloads"| node_secu
node_protocol -->|"decodes responses"| node_decode
node_transport -->|"calls firmware"| node_acpi

click node_gui "https://github.com/jackockzuo/omen-rs/blob/main/extra-noctalia-plugin/omen/service.luau"
click node_cli "https://github.com/jackockzuo/omen-rs/blob/main/src/main.rs"
click node_client "https://github.com/jackockzuo/omen-rs/blob/main/src/client.rs"
click node_omend "https://github.com/jackockzuo/omen-rs/blob/main/src/bin/omend.rs"
click node_curve "https://github.com/jackockzuo/omen-rs/blob/main/src/fan_curve.rs"
click node_commands "https://github.com/jackockzuo/omen-rs/blob/main/src/commands/mod.rs"
click node_capability "https://github.com/jackockzuo/omen-rs/blob/main/src/capability.rs"
click node_powerprofile "https://github.com/jackockzuo/omen-rs/blob/main/src/commands/power_profile.rs"
click node_fan "https://github.com/jackockzuo/omen-rs/blob/main/src/commands/fan.rs"
click node_sensors "https://github.com/jackockzuo/omen-rs/blob/main/src/commands/sensors.rs"
click node_gpu "https://github.com/jackockzuo/omen-rs/blob/main/src/commands/gpu.rs"
click node_battery "https://github.com/jackockzuo/omen-rs/blob/main/src/commands/battery.rs"
click node_othercommands "https://github.com/jackockzuo/omen-rs/tree/main/src/commands"
click node_transport "https://github.com/jackockzuo/omen-rs/blob/main/src/transport.rs"
click node_ec "https://github.com/jackockzuo/omen-rs/blob/main/src/ec.rs"
click node_protocol "https://github.com/jackockzuo/omen-rs/tree/main/src/protocol"
click node_secu "https://github.com/jackockzuo/omen-rs/blob/main/src/protocol/secu.rs"
click node_decode "https://github.com/jackockzuo/omen-rs/blob/main/src/protocol/decode.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_cli,node_client,node_user toneBlue
class node_omend,node_fanmode,node_curve toneAmber
class node_commands,node_capability,node_powerprofile,node_fan,node_sensors,node_gpu,node_battery,node_othercommands toneMint
class node_transport,node_ec toneRose
class node_protocol,node_secu,node_decode,node_acpi,node_ecsys,node_profilefs,node_hwmon toneIndigo
class node_gui toneTeal
```

## Components

### User interfaces

- [omen CLI](https://github.com/jackockzuo/omen-rs/blob/main/src/main.rs): `src/main.rs`
- [Socket client](https://github.com/jackockzuo/omen-rs/blob/main/src/client.rs): `src/client.rs`

### Daemon services

- [omend daemon](https://github.com/jackockzuo/omen-rs/blob/main/src/bin/omend.rs): `src/bin/omend.rs`
- **Fan mode file**
- [Fan curve](https://github.com/jackockzuo/omen-rs/blob/main/src/fan_curve.rs): `src/fan_curve.rs`

### OMEN controls

- [Command registry](https://github.com/jackockzuo/omen-rs/blob/main/src/commands/mod.rs): `src/commands/mod.rs`
- [Capability gate](https://github.com/jackockzuo/omen-rs/blob/main/src/capability.rs): `src/capability.rs`
- [Power profiles](https://github.com/jackockzuo/omen-rs/blob/main/src/commands/power_profile.rs): `src/commands/power_profile.rs`
- [Fan control](https://github.com/jackockzuo/omen-rs/blob/main/src/commands/fan.rs): `src/commands/fan.rs`
- [Sensors](https://github.com/jackockzuo/omen-rs/blob/main/src/commands/sensors.rs): `src/commands/sensors.rs`
- [GPU power](https://github.com/jackockzuo/omen-rs/blob/main/src/commands/gpu.rs): `src/commands/gpu.rs`
- [Battery care](https://github.com/jackockzuo/omen-rs/blob/main/src/commands/battery.rs): `src/commands/battery.rs`
- [Other controls](https://github.com/jackockzuo/omen-rs/tree/main/src/commands): `src/commands`

### Hardware access

- [ACPI transport](https://github.com/jackockzuo/omen-rs/blob/main/src/transport.rs): `src/transport.rs`
- [EC access](https://github.com/jackockzuo/omen-rs/blob/main/src/ec.rs): `src/ec.rs`

### Protocol

- [WMAA protocol](https://github.com/jackockzuo/omen-rs/tree/main/src/protocol): `src/protocol`
- [SECU encoding](https://github.com/jackockzuo/omen-rs/blob/main/src/protocol/secu.rs): `src/protocol/secu.rs`
- [Response decoding](https://github.com/jackockzuo/omen-rs/blob/main/src/protocol/decode.rs): `src/protocol/decode.rs`

### Other components

- **User**
- [Noctalia plugin](https://github.com/jackockzuo/omen-rs/blob/main/extra-noctalia-plugin/omen/service.luau): `extra-noctalia-plugin/omen/service.luau`
- **ACPI call interface**
- **EC debugfs**
- **Platform profile**
- **CPU hwmon**

## Connections

- User → omen CLI: runs commands
- Noctalia plugin → Fan mode file: selects mode
- omen CLI → Command registry: dispatches controls
- omen CLI → Socket client: routes read queries
- Socket client → omend daemon: sends socket requests
- omend daemon → Command registry: dispatches read commands
- omend daemon → Power profiles: reapplies profile
- omend daemon → Fan mode file: reads mode
- omend daemon → Sensors: reads CPU temperature
- omend daemon → Fan curve: evaluates temperature
- omend daemon → Fan control: sets fan speed
- Command registry → Capability gate: checks capabilities
- Capability gate → ACPI transport: queries hardware
- Command registry → Fan control: dispatches fan operations
- Command registry → GPU power: dispatches GPU operations
- Command registry → Battery care: dispatches battery operations
- Command registry → Other controls: dispatches other features
- Fan control → ACPI transport: issues WMAA calls
- GPU power → ACPI transport: issues WMAA calls
- Sensors → ACPI transport: reads WMAA sensors
- Sensors → CPU hwmon: reads CPU temperatures
- Power profiles → EC access: reads and writes EC
- Power profiles → Platform profile: reads and writes profile
- EC access → EC debugfs: accesses registers
- ACPI transport → WMAA protocol: formats and decodes
- WMAA protocol → SECU encoding: builds ACPI payloads
- WMAA protocol → Response decoding: decodes responses
- ACPI transport → ACPI call interface: calls firmware
