# hakatamike/omarchy-usb-storage architecture

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

- Interactive diagram: https://gitdiagram.com/hakatamike/omarchy-usb-storage
- Repository: https://github.com/hakatamike/omarchy-usb-storage

## Overview

USB Storage for Omarchy is a shell bar widget for inspecting connected USB drives and safely ejecting them. The principal workflow runs from the panel through the helper: the helper provides drive data, the model formats it, and the panel presents drive details and actions. Ejecting delegates to udisks and notifies when removal is safe; opening a mounted drive uses the file manager. The README documents udev hotplug and optional automounting, but the helper and QML implementation were not sampled, so those integration details are limited to documented relationships.

Main entry points: [`Panel.qml`](https://github.com/hakatamike/omarchy-usb-storage/blob/main/Panel.qml) (Panel and popup), [`usb-storage`](https://github.com/hakatamike/omarchy-usb-storage/blob/main/usb-storage) (USB helper), [`Model.js`](https://github.com/hakatamike/omarchy-usb-storage/blob/main/Model.js) (Drive formatting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Widget UI"]
  node_panel["Panel and popup<br/>[Panel.qml]"]
  node_model["Drive formatting<br/>[Model.js]"]
end

subgraph group_drive["Drive handling"]
  node_helper["USB helper"]
end

subgraph group_system["System integrations"]
  node_udev["udev hotplug"]
  node_udisks["udisks2"]
  node_automounter["Optional automounter"]
  node_filemanager["File manager"]
  node_notifier["Notifications"]
end

node_user(("User"))

node_user -->|"opens and acts"| node_panel
node_udev -->|"signals hotplug"| node_panel
node_panel -->|"requests drive data or eject"| node_helper
node_helper -->|"returns drive JSON"| node_panel
node_panel -->|"formats drive data"| node_model
node_helper -->|"unmounts and powers off"| node_udisks
node_panel -->|"opens mounted drive"| node_filemanager
node_helper -->|"reports safe removal"| node_notifier
node_automounter -.->|"enables mount data"| node_helper

click node_panel "https://github.com/hakatamike/omarchy-usb-storage/blob/main/Panel.qml"
click node_model "https://github.com/hakatamike/omarchy-usb-storage/blob/main/Model.js"
click node_helper "https://github.com/hakatamike/omarchy-usb-storage/blob/main/usb-storage"

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_panel,node_model,node_user toneBlue
class node_helper toneAmber
class node_udev,node_udisks,node_automounter,node_filemanager,node_notifier toneMint
```

## Components

### Widget UI

- [Panel and popup](https://github.com/hakatamike/omarchy-usb-storage/blob/main/Panel.qml): `Panel.qml`
- [Drive formatting](https://github.com/hakatamike/omarchy-usb-storage/blob/main/Model.js): `Model.js`

### Drive handling

- [USB helper](https://github.com/hakatamike/omarchy-usb-storage/blob/main/usb-storage): `usb-storage`

### System integrations

- **udev hotplug**
- **udisks2**
- **Optional automounter**
- **File manager**
- **Notifications**

### Other components

- **User**

## Connections

- User → Panel and popup: opens and acts (evidence: `README.md`)
- udev hotplug → Panel and popup: signals hotplug (evidence: `README.md`)
- Panel and popup → USB helper: requests drive data or eject (evidence: `README.md`)
- USB helper → Panel and popup: returns drive JSON (evidence: `README.md`)
- Panel and popup → Drive formatting: formats drive data (evidence: `README.md`)
- USB helper → udisks2: unmounts and powers off (evidence: `README.md`)
- Panel and popup → File manager: opens mounted drive (evidence: `README.md`)
- USB helper → Notifications: reports safe removal (evidence: `README.md`)
- Optional automounter → USB helper: enables mount data (evidence: `README.md`)
