# revans/omarchy-brainfm architecture

> Architecture diagram of the GitHub repository revans/omarchy-brainfm, 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/revans/omarchy-brainfm
- Repository: https://github.com/revans/omarchy-brainfm
- Video tour (about a minute): https://gitdiagram.com/revans/omarchy-brainfm/video

## Overview

omarchy-brainfm is an Omarchy bar plugin that surfaces brain.fm playback without requiring users to find its browser tab. The documented workflow is to open the bar popup, inspect what is playing, and use transport controls; clicking the icon also launches or focuses brain.fm. The tree identifies the bar, icon, service, and media-model modules, but only MediaModel.js was sampled, so detailed QML wiring is uncertain and omitted.

Main entry points: [`Service.qml`](https://github.com/revans/omarchy-brainfm/blob/main/Service.qml) (Media service), [`BarWidget.qml`](https://github.com/revans/omarchy-brainfm/blob/main/BarWidget.qml) (Bar widget), [`BrainIcon.qml`](https://github.com/revans/omarchy-brainfm/blob/main/BrainIcon.qml) (Brain icon), [`MediaModel.js`](https://github.com/revans/omarchy-brainfm/blob/main/MediaModel.js) (Media model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bar["Bar interface"]
  node_barwidget["Bar widget<br/>[BarWidget.qml]"]
  node_brainicon["Brain icon<br/>[BrainIcon.qml]"]
end

subgraph group_media["Playback integration"]
  node_service["Media service<br/>[Service.qml]"]
  node_mediamodel["Media model<br/>[MediaModel.js]"]
end

subgraph group_launch["App access"]
  node_brainfm["brain.fm"]
end

node_user(("User"))
node_omarchy["Omarchy bar"]
node_mpris["Browser MPRIS"]

node_omarchy -->|"hosts"| node_barwidget
node_user -->|"clicks"| node_barwidget
node_barwidget -->|"shows"| node_brainicon
node_barwidget -->|"controls playback"| node_service
node_service -->|"reads playback"| node_mpris
node_service -->|"uses helpers"| node_mediamodel
node_user -->|"launches or focuses"| node_brainfm
node_service -->|"provides playback state"| node_brainicon

click node_barwidget "https://github.com/revans/omarchy-brainfm/blob/main/BarWidget.qml"
click node_brainicon "https://github.com/revans/omarchy-brainfm/blob/main/BrainIcon.qml"
click node_service "https://github.com/revans/omarchy-brainfm/blob/main/Service.qml"
click node_mediamodel "https://github.com/revans/omarchy-brainfm/blob/main/MediaModel.js"

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_barwidget,node_brainicon,node_user,node_mpris toneBlue
class node_service,node_mediamodel toneAmber
class node_brainfm toneMint
class node_omarchy toneIndigo
```

## Components

### Bar interface

- [Bar widget](https://github.com/revans/omarchy-brainfm/blob/main/BarWidget.qml): `BarWidget.qml`
- [Brain icon](https://github.com/revans/omarchy-brainfm/blob/main/BrainIcon.qml): `BrainIcon.qml`

### Playback integration

- [Media service](https://github.com/revans/omarchy-brainfm/blob/main/Service.qml): `Service.qml`
- [Media model](https://github.com/revans/omarchy-brainfm/blob/main/MediaModel.js): `MediaModel.js`

### App access

- **brain.fm**

### Other components

- **User**
- **Omarchy bar**
- **Browser MPRIS**

## Connections

- Omarchy bar → Bar widget: hosts
- User → Bar widget: clicks
- Bar widget → Brain icon: shows
- Bar widget → Media service: controls playback
- Media service → Browser MPRIS: reads playback
- Media service → Media model: uses helpers
- User → brain.fm: launches or focuses
- Media service → Brain icon: provides playback state
