# ysph/ghub-gui architecture

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

- Interactive diagram: https://gitdiagram.com/ysph/ghub-gui
- Repository: https://github.com/ysph/ghub-gui

## Overview

gHub-GUI manages Logitech devices on Linux; the documented completed capability is setting a static LED colour for the primary or logo zone. The sampled runtime is a command-line workflow: it builds device lists, discovers and selects a supported mouse, then sends a USB control transfer. The README calls the product a GUI, but the shown interaction uses terminal input. The source excerpts do not show a broader GUI or implementation of the listed missing features.

Main entry points: [`main.c`](https://github.com/ysph/ghub-gui/blob/master/main.c) (Device selection), [`mouselist.c`](https://github.com/ysph/ghub-gui/blob/master/mouselist.c) (Device registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Device workflow"]
  node_device_workflow["Device selection<br/>[main.c]"]
  node_led_command["LED command<br/>[main.c]"]
end

subgraph group_catalog["Device catalog"]
  node_device_catalog[("Device registry<br/>[mouselist.c]")]
end

subgraph group_usb["USB access"]
  node_usb_runtime["USB runtime"]
  node_logitech_mouse["Logitech mouse"]
end

node_operator(("Operator"))

node_operator -->|"chooses device"| node_device_workflow
node_device_workflow -->|"queries entries"| node_device_catalog
node_device_workflow -->|"scans devices"| node_usb_runtime
node_device_workflow -->|"configures command"| node_led_command
node_led_command -->|"sends control transfer"| node_usb_runtime
node_usb_runtime -->|"transfers LED data"| node_logitech_mouse

click node_device_workflow "https://github.com/ysph/ghub-gui/blob/master/main.c"
click node_led_command "https://github.com/ysph/ghub-gui/blob/master/main.c"
click node_device_catalog "https://github.com/ysph/ghub-gui/blob/master/mouselist.c"

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_device_workflow,node_led_command toneBlue
class node_device_catalog toneAmber
class node_usb_runtime,node_logitech_mouse toneMint
class node_operator toneIndigo
```

## Components

### Device workflow

- [Device selection](https://github.com/ysph/ghub-gui/blob/master/main.c): `main.c`
- [LED command](https://github.com/ysph/ghub-gui/blob/master/main.c): `main.c`

### Device catalog

- [Device registry](https://github.com/ysph/ghub-gui/blob/master/mouselist.c): `mouselist.c`

### USB access

- **USB runtime**
- **Logitech mouse**

### Other components

- **Operator**

## Connections

- Operator → Device selection: chooses device (evidence: `main.c`)
- Device selection → Device registry: queries entries (evidence: `main.c`)
- Device selection → USB runtime: scans devices (evidence: `main.c`)
- Device selection → LED command: configures command (evidence: `main.c`)
- LED command → USB runtime: sends control transfer (evidence: `main.c`)
- USB runtime → Logitech mouse: transfers LED data
