# hablethedev/mfogtmigfswmm architecture

> Architecture diagram of the GitHub repository hablethedev/mfogtmigfswmm, 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/hablethedev/mfogtmigfswmm
- Repository: https://github.com/hablethedev/mfogtmigfswmm

## Overview

MFOGTMIGFSWMM is a small Go gaming timer for Sway. Users send start, stop, and reset commands through the documented Unix-socket bindings; the game loop updates and renders the timer in a floating transparent window. The timer state, socket handling, font setup, and Ebiten game are implemented together in main.go, so the diagram separates their responsibilities without implying separate packages. The README documents the external command workflow; implementation details are evidenced by the sampled main.go.

Main entry points: [`main.go`](https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go) (Ebiten game loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_controls["Timer control"]
  node_socket["Unix socket listener<br/>[main.go]"]
  node_commands["Command handler<br/>[main.go]"]
  node_timer_state["Timer state<br/>[main.go]"]
end

subgraph group_display["Timer display"]
  node_game_loop["Ebiten game loop<br/>[main.go]"]
  node_font["Font setup<br/>[main.go]"]
  node_timer_window["Timer window<br/>[main.go]"]
end

node_sway_user(("Sway user"))

node_sway_user -->|"sends commands"| node_socket
node_game_loop -->|"starts listener"| node_socket
node_socket -->|"dispatches connections"| node_commands
node_commands -->|"updates state"| node_timer_state
node_game_loop -->|"updates elapsed time"| node_timer_state
node_game_loop -->|"reads for display"| node_timer_state
node_game_loop -->|"uses font face"| node_font
node_game_loop -->|"runs game"| node_timer_window

click node_socket "https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go"
click node_commands "https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go"
click node_timer_state "https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go"
click node_game_loop "https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go"
click node_font "https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go"
click node_timer_window "https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go"

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_socket,node_commands,node_timer_state,node_sway_user toneBlue
class node_game_loop,node_font,node_timer_window toneAmber
```

## Components

### Timer control

- [Unix socket listener](https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go): `main.go`
- [Command handler](https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go): `main.go`
- [Timer state](https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go): `main.go`

### Timer display

- [Ebiten game loop](https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go): `main.go`
- [Font setup](https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go): `main.go`
- [Timer window](https://github.com/hablethedev/mfogtmigfswmm/blob/main/main.go): `main.go`

### Other components

- **Sway user**

## Connections

- Sway user → Unix socket listener: sends commands (evidence: `README.md`)
- Ebiten game loop → Unix socket listener: starts listener (evidence: `main.go`)
- Unix socket listener → Command handler: dispatches connections (evidence: `main.go`)
- Command handler → Timer state: updates state (evidence: `main.go`)
- Ebiten game loop → Timer state: updates elapsed time (evidence: `main.go`)
- Ebiten game loop → Timer state: reads for display (evidence: `main.go`)
- Ebiten game loop → Font setup: uses font face (evidence: `main.go`)
- Ebiten game loop → Timer window: runs game (evidence: `main.go`)
