📌 Feature Summary
Implement Discord Rich Presence (RPC) to show live radio status on Discord, along with a lightweight CLI query/IPC mode (halpradio current, halpradio toggle, halpradio status --json) for status bars (tmux, Waybar, Polybar, SketchyBar).
🎯 Motivation & User Story
"As a developer and ricing enthusiast, I want to show my currently playing radio station and Animal DJ avatar on Discord, and embed my current playing track in my tmux statusline or Waybar without keeping the full TUI window open."
Customizing desktop status bars and sharing musical vibes on Discord is a core ritual for terminal and Linux/macOS ricing communities. Providing simple IPC commands makes halpradio universally scriptable.
💻 Proposed Functional Specification
1. Discord Rich Presence (RPC)
- Updates Discord profile activity in real time:
- State:
Station Name (e.g. SomaFM Groove Salad)
- Details:
Artist - Title (or Streaming Live...)
- Large Image:
halpradio_logo with hover text "halpradio - Terminal Internet Radio"
- Small Image: Active Animal DJ character icon (
dj_cat, dj_dog, dj_bear, dj_frog, dj_bunny)
- Timestamps: Elapsed listening duration.
- Toggle via CLI flag
-discord or config.yaml (discord_rpc: true/false).
2. CLI IPC & Status Line Query Mode
- Non-interactive CLI subcommands that communicate with a running
halpradio instance:
halpradio current: Outputs plain text: SomaFM Groove Salad: Tycho - A Walk
halpradio current --json: Returns JSON payload:
{
"status": "playing",
"station_id": "somafm_groovesalad",
"station_name": "SomaFM Groove Salad",
"artist": "Tycho",
"title": "A Walk",
"bitrate": 128,
"backend": "mpv",
"volume": 80,
"visualizer": "dj-cat"
}
- Remote controls:
halpradio remote toggle
halpradio remote next
halpradio remote prev
halpradio remote stop
🏗️ Technical & Architectural Guidelines
- Discord RPC Implementation:
- Use a lightweight Discord IPC package (e.g.
hugolgst/rich-go or direct named pipe / unix domain socket connection /tmp/discord-ipc-0).
- Must run non-blocking in background; fail silently if Discord is not running.
- Local IPC Server:
- When
halpradio starts, create a local Unix domain socket (or Windows named pipe) at ~/.config/halpradio/halpradio.sock.
- CLI subcommands connect to this socket to query status or send control commands.
- Remote commands trigger corresponding
tea.Msg events on the main Bubble Tea program loop.
✅ Acceptance Criteria
📌 Feature Summary
Implement Discord Rich Presence (RPC) to show live radio status on Discord, along with a lightweight CLI query/IPC mode (
halpradio current,halpradio toggle,halpradio status --json) for status bars (tmux, Waybar, Polybar, SketchyBar).🎯 Motivation & User Story
Customizing desktop status bars and sharing musical vibes on Discord is a core ritual for terminal and Linux/macOS ricing communities. Providing simple IPC commands makes
halpradiouniversally scriptable.💻 Proposed Functional Specification
1. Discord Rich Presence (RPC)
Station Name(e.g.SomaFM Groove Salad)Artist - Title(orStreaming Live...)halpradio_logowith hover text"halpradio - Terminal Internet Radio"dj_cat,dj_dog,dj_bear,dj_frog,dj_bunny)-discordorconfig.yaml(discord_rpc: true/false).2. CLI IPC & Status Line Query Mode
halpradioinstance:halpradio current: Outputs plain text:SomaFM Groove Salad: Tycho - A Walkhalpradio current --json: Returns JSON payload:{ "status": "playing", "station_id": "somafm_groovesalad", "station_name": "SomaFM Groove Salad", "artist": "Tycho", "title": "A Walk", "bitrate": 128, "backend": "mpv", "volume": 80, "visualizer": "dj-cat" }halpradio remote togglehalpradio remote nexthalpradio remote prevhalpradio remote stop🏗️ Technical & Architectural Guidelines
hugolgst/rich-goor direct named pipe / unix domain socket connection/tmp/discord-ipc-0).halpradiostarts, create a local Unix domain socket (or Windows named pipe) at~/.config/halpradio/halpradio.sock.tea.Msgevents on the main Bubble Tea program loop.✅ Acceptance Criteria
halpradiostatus with station, track info, and active DJ avatar when enabled.halpradio currentandhalpradio current --jsonoutput accurate live stream state for status bars.halpradio remote [toggle|next|prev|stop]correctly manipulates the running instance.