# rehamfarhan/scripts architecture

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

- Interactive diagram: https://gitdiagram.com/rehamfarhan/scripts
- Repository: https://github.com/rehamfarhan/scripts

## Overview

This repository is a collection of independent terminal utilities, not one application. Users invoke a tool for a task; the README documents each utility’s purpose and identifies scrlink as the helper for system-wide symlinks. The clearest internal workflows are the Rust mediafetch downloader and the run game launcher, whose sampled entry points and module references expose their main orchestration. Other utilities are represented at product level because their source was not sampled. Connections among those independent tools are not implied.

Main entry points: [`mediafetch/src/main.rs`](https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/main.rs) (Mediafetch CLI), [`run/src/main.rs`](https://github.com/rehamfarhan/scripts/blob/main/run/src/main.rs) (Game launcher CLI), [`mediafetch/src/downloader.rs`](https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/downloader.rs) (Media downloader), [`mediafetch/src/ui.rs`](https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/ui.rs) (Download TUI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_media["Media Handling"]
  node_mediafetch["Mediafetch CLI<br/>[main.rs]"]
  node_media_ui["Download TUI<br/>[ui.rs]"]
  node_media_downloader["Media downloader<br/>[downloader.rs]"]
  node_media_lyrics["Lyrics tagging<br/>[lyrics.rs]"]
  node_media_metadata["Media metadata<br/>[metadata.rs]"]
  node_media_presets["Download presets<br/>[presets.rs]"]
  node_legacy_mediafetch["Legacy mediafetch<br/>[mediafetch.py]"]
  node_modfetch["Modrinth installer<br/>[modfetch.py]"]
end

subgraph group_games["Game Launching"]
  node_run_cli["Game launcher CLI<br/>[main.rs]"]
  node_run_tui["Game dashboard<br/>[mod.rs]"]
  node_run_app["Dashboard state<br/>[app.rs]"]
  node_run_events["TUI events<br/>[events.rs]"]
  node_run_scanner["Game scanner<br/>[scanner.rs]"]
  node_run_database[("Game database<br/>[db.rs]")]
  node_run_model["Game records<br/>[model.rs]"]
  node_run_config["Launcher config<br/>[config.rs]"]
  node_run_launcher["Game execution<br/>[launcher.rs]"]
  node_run_recap["Session recap<br/>[recap.rs]"]
  node_ddlclauncher["DDLC mod manager<br/>[ddlclauncher.sh]"]
end

subgraph group_system["System Utilities"]
  node_keydmgr["keyd manager<br/>[keydmgr.py]"]
  node_mkrofi["Desktop entry creator<br/>[mkrofi.sh]"]
  node_barr["Waybar restarter<br/>[barr.sh]"]
  node_raminfo["Memory display<br/>[raminfo.sh]"]
  node_scrlink["Script symlinker<br/>[scrlink.sh]"]
end

subgraph group_personal["Personal Tools"]
  node_money["Financial ledger<br/>[money.py]"]
  node_morsegen["Morse encoder<br/>[morsegen.py]"]
  node_rng["Number generator<br/>[rng.py]"]
  node_rngname["Picture renamer<br/>[rngname.py]"]
end

node_user(("Terminal user"))
node_yt_dlp["yt-dlp"]
node_lrclib["LRCLIB"]
node_modfetch_service["Modrinth"]
node_fzf["fzf"]

node_user -->|"invokes"| node_mediafetch
node_user -->|"invokes"| node_legacy_mediafetch
node_user -->|"invokes"| node_modfetch
node_user -->|"invokes"| node_run_cli
node_user -->|"invokes"| node_ddlclauncher
node_user -->|"invokes"| node_money
node_user -->|"invokes"| node_morsegen
node_user -->|"invokes"| node_rng
node_user -->|"invokes"| node_rngname
node_user -->|"invokes"| node_keydmgr
node_user -->|"invokes"| node_mkrofi
node_user -->|"invokes"| node_barr
node_user -->|"invokes"| node_raminfo
node_user -->|"invokes"| node_scrlink
node_mediafetch -->|"runs"| node_media_ui
node_mediafetch -->|"dispatches"| node_media_downloader
node_mediafetch -->|"fetches"| node_media_metadata
node_mediafetch -->|"selects"| node_media_presets
node_media_ui -->|"uses"| node_media_downloader
node_media_ui -->|"uses"| node_media_metadata
node_media_ui -->|"uses"| node_media_presets
node_media_downloader -->|"tags lyrics"| node_media_lyrics
node_media_downloader -->|"uses"| node_media_metadata
node_media_downloader -->|"uses"| node_media_presets
node_mediafetch -->|"wraps"| node_yt_dlp
node_media_lyrics -->|"queries"| node_lrclib
node_modfetch -->|"installs from"| node_modfetch_service
node_modfetch -->|"uses"| node_fzf
node_run_cli -->|"resolves path"| node_run_config
node_run_cli -->|"opens"| node_run_database
node_run_cli -->|"quick launches"| node_run_launcher
node_run_cli -->|"starts"| node_run_tui
node_run_tui -->|"uses"| node_run_app
node_run_tui -->|"handles input"| node_run_events
node_run_events -->|"updates"| node_run_app
node_run_app -->|"scans with"| node_run_scanner
node_run_app -->|"reads"| node_run_database
node_run_database -->|"uses records"| node_run_model
node_run_launcher -->|"reads"| node_run_database
node_run_launcher -->|"uses"| node_run_scanner
node_run_launcher -->|"records session"| node_run_recap
node_scrlink -->|"selects scripts"| node_fzf

click node_mediafetch "https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/main.rs"
click node_media_ui "https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/ui.rs"
click node_media_downloader "https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/downloader.rs"
click node_media_lyrics "https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/lyrics.rs"
click node_media_metadata "https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/metadata.rs"
click node_media_presets "https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/presets.rs"
click node_legacy_mediafetch "https://github.com/rehamfarhan/scripts/blob/main/deprecated-mediafetch/mediafetch.py"
click node_modfetch "https://github.com/rehamfarhan/scripts/blob/main/modfetch/modfetch.py"
click node_run_cli "https://github.com/rehamfarhan/scripts/blob/main/run/src/main.rs"
click node_run_tui "https://github.com/rehamfarhan/scripts/blob/main/run/src/ui/mod.rs"
click node_run_app "https://github.com/rehamfarhan/scripts/blob/main/run/src/ui/app.rs"
click node_run_events "https://github.com/rehamfarhan/scripts/blob/main/run/src/ui/events.rs"
click node_run_scanner "https://github.com/rehamfarhan/scripts/blob/main/run/src/scanner.rs"
click node_run_database "https://github.com/rehamfarhan/scripts/blob/main/run/src/db.rs"
click node_run_model "https://github.com/rehamfarhan/scripts/blob/main/run/src/model.rs"
click node_run_config "https://github.com/rehamfarhan/scripts/blob/main/run/src/config.rs"
click node_run_launcher "https://github.com/rehamfarhan/scripts/blob/main/run/src/launcher.rs"
click node_run_recap "https://github.com/rehamfarhan/scripts/blob/main/run/src/recap.rs"
click node_ddlclauncher "https://github.com/rehamfarhan/scripts/blob/main/ddlclauncher/ddlclauncher.sh"
click node_money "https://github.com/rehamfarhan/scripts/blob/main/money/money.py"
click node_morsegen "https://github.com/rehamfarhan/scripts/blob/main/morsegen/morsegen.py"
click node_rng "https://github.com/rehamfarhan/scripts/blob/main/rng/rng.py"
click node_rngname "https://github.com/rehamfarhan/scripts/blob/main/rngname/rngname.py"
click node_keydmgr "https://github.com/rehamfarhan/scripts/blob/main/keydmgr/keydmgr.py"
click node_mkrofi "https://github.com/rehamfarhan/scripts/blob/main/mkrofi/mkrofi.sh"
click node_barr "https://github.com/rehamfarhan/scripts/blob/main/barr/barr.sh"
click node_raminfo "https://github.com/rehamfarhan/scripts/blob/main/raminfo/raminfo.sh"
click node_scrlink "https://github.com/rehamfarhan/scripts/blob/main/scrlink/scrlink.sh"

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_mediafetch,node_media_ui,node_media_downloader,node_media_lyrics,node_media_metadata,node_media_presets,node_legacy_mediafetch,node_modfetch,node_user toneBlue
class node_run_cli,node_run_tui,node_run_app,node_run_events,node_run_scanner,node_run_database,node_run_model,node_run_config,node_run_launcher,node_run_recap,node_ddlclauncher toneAmber
class node_keydmgr,node_mkrofi,node_barr,node_raminfo,node_scrlink toneMint
class node_money,node_morsegen,node_rng,node_rngname toneRose
class node_yt_dlp,node_lrclib,node_modfetch_service,node_fzf toneIndigo
```

## Components

### Media Handling

- [Mediafetch CLI](https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/main.rs): `mediafetch/src/main.rs`
- [Download TUI](https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/ui.rs): `mediafetch/src/ui.rs`
- [Media downloader](https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/downloader.rs): `mediafetch/src/downloader.rs`
- [Lyrics tagging](https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/lyrics.rs): `mediafetch/src/lyrics.rs`
- [Media metadata](https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/metadata.rs): `mediafetch/src/metadata.rs`
- [Download presets](https://github.com/rehamfarhan/scripts/blob/main/mediafetch/src/presets.rs): `mediafetch/src/presets.rs`
- [Legacy mediafetch](https://github.com/rehamfarhan/scripts/blob/main/deprecated-mediafetch/mediafetch.py): `deprecated-mediafetch/mediafetch.py`
- [Modrinth installer](https://github.com/rehamfarhan/scripts/blob/main/modfetch/modfetch.py): `modfetch/modfetch.py`

### Game Launching

- [Game launcher CLI](https://github.com/rehamfarhan/scripts/blob/main/run/src/main.rs): `run/src/main.rs`
- [Game dashboard](https://github.com/rehamfarhan/scripts/blob/main/run/src/ui/mod.rs): `run/src/ui/mod.rs`
- [Dashboard state](https://github.com/rehamfarhan/scripts/blob/main/run/src/ui/app.rs): `run/src/ui/app.rs`
- [TUI events](https://github.com/rehamfarhan/scripts/blob/main/run/src/ui/events.rs): `run/src/ui/events.rs`
- [Game scanner](https://github.com/rehamfarhan/scripts/blob/main/run/src/scanner.rs): `run/src/scanner.rs`
- [Game database](https://github.com/rehamfarhan/scripts/blob/main/run/src/db.rs): `run/src/db.rs`
- [Game records](https://github.com/rehamfarhan/scripts/blob/main/run/src/model.rs): `run/src/model.rs`
- [Launcher config](https://github.com/rehamfarhan/scripts/blob/main/run/src/config.rs): `run/src/config.rs`
- [Game execution](https://github.com/rehamfarhan/scripts/blob/main/run/src/launcher.rs): `run/src/launcher.rs`
- [Session recap](https://github.com/rehamfarhan/scripts/blob/main/run/src/recap.rs): `run/src/recap.rs`
- [DDLC mod manager](https://github.com/rehamfarhan/scripts/blob/main/ddlclauncher/ddlclauncher.sh): `ddlclauncher/ddlclauncher.sh`

### System Utilities

- [keyd manager](https://github.com/rehamfarhan/scripts/blob/main/keydmgr/keydmgr.py): `keydmgr/keydmgr.py`
- [Desktop entry creator](https://github.com/rehamfarhan/scripts/blob/main/mkrofi/mkrofi.sh): `mkrofi/mkrofi.sh`
- [Waybar restarter](https://github.com/rehamfarhan/scripts/blob/main/barr/barr.sh): `barr/barr.sh`
- [Memory display](https://github.com/rehamfarhan/scripts/blob/main/raminfo/raminfo.sh): `raminfo/raminfo.sh`
- [Script symlinker](https://github.com/rehamfarhan/scripts/blob/main/scrlink/scrlink.sh): `scrlink/scrlink.sh`

### Personal Tools

- [Financial ledger](https://github.com/rehamfarhan/scripts/blob/main/money/money.py): `money/money.py`
- [Morse encoder](https://github.com/rehamfarhan/scripts/blob/main/morsegen/morsegen.py): `morsegen/morsegen.py`
- [Number generator](https://github.com/rehamfarhan/scripts/blob/main/rng/rng.py): `rng/rng.py`
- [Picture renamer](https://github.com/rehamfarhan/scripts/blob/main/rngname/rngname.py): `rngname/rngname.py`

### Other components

- **Terminal user**
- **yt-dlp**
- **LRCLIB**
- **Modrinth**
- **fzf**

## Connections

- Terminal user → Mediafetch CLI: invokes (evidence: `README.md`)
- Terminal user → Legacy mediafetch: invokes (evidence: `README.md`)
- Terminal user → Modrinth installer: invokes (evidence: `README.md`)
- Terminal user → Game launcher CLI: invokes (evidence: `README.md`)
- Terminal user → DDLC mod manager: invokes (evidence: `README.md`)
- Terminal user → Financial ledger: invokes (evidence: `README.md`)
- Terminal user → Morse encoder: invokes (evidence: `README.md`)
- Terminal user → Number generator: invokes (evidence: `README.md`)
- Terminal user → Picture renamer: invokes (evidence: `README.md`)
- Terminal user → keyd manager: invokes (evidence: `README.md`)
- Terminal user → Desktop entry creator: invokes (evidence: `README.md`)
- Terminal user → Waybar restarter: invokes (evidence: `README.md`)
- Terminal user → Memory display: invokes (evidence: `README.md`)
- Terminal user → Script symlinker: invokes (evidence: `README.md`)
- Mediafetch CLI → Download TUI: runs (evidence: `mediafetch/src/main.rs`)
- Mediafetch CLI → Media downloader: dispatches (evidence: `mediafetch/src/main.rs`)
- Mediafetch CLI → Media metadata: fetches (evidence: `mediafetch/src/main.rs`)
- Mediafetch CLI → Download presets: selects (evidence: `mediafetch/src/main.rs`)
- Download TUI → Media downloader: uses (evidence: `mediafetch/src/ui.rs`)
- Download TUI → Media metadata: uses (evidence: `mediafetch/src/ui.rs`)
- Download TUI → Download presets: uses (evidence: `mediafetch/src/ui.rs`)
- Media downloader → Lyrics tagging: tags lyrics (evidence: `mediafetch/src/downloader.rs`)
- Media downloader → Media metadata: uses (evidence: `mediafetch/src/downloader.rs`)
- Media downloader → Download presets: uses (evidence: `mediafetch/src/downloader.rs`)
- Mediafetch CLI → yt-dlp: wraps (evidence: `README.md`)
- Lyrics tagging → LRCLIB: queries (evidence: `README.md`)
- Modrinth installer → Modrinth: installs from (evidence: `README.md`)
- Modrinth installer → fzf: uses (evidence: `README.md`)
- Game launcher CLI → Launcher config: resolves path (evidence: `run/src/main.rs`)
- Game launcher CLI → Game database: opens (evidence: `run/src/main.rs`)
- Game launcher CLI → Game execution: quick launches (evidence: `run/src/main.rs`)
- Game launcher CLI → Game dashboard: starts (evidence: `run/src/main.rs`)
- Game dashboard → Dashboard state: uses (evidence: `run/src/ui/mod.rs`)
- Game dashboard → TUI events: handles input (evidence: `run/src/ui/mod.rs`)
- TUI events → Dashboard state: updates (evidence: `run/src/ui/events.rs`)
- Dashboard state → Game scanner: scans with (evidence: `run/src/ui/app.rs`)
- Dashboard state → Game database: reads (evidence: `run/src/ui/app.rs`)
- Game database → Game records: uses records (evidence: `run/src/db.rs`)
- Game execution → Game database: reads (evidence: `run/src/launcher.rs`)
- Game execution → Game scanner: uses (evidence: `run/src/launcher.rs`)
- Game execution → Session recap: records session (evidence: `run/src/launcher.rs`)
- Script symlinker → fzf: selects scripts (evidence: `README.md`)
