dots


dots / config / .local / bin
xxwhirlpool  ·  2026-04-09

radio

 1#!/usr/bin/env bash
 2
 3# stream URLs
 4
 5declare -A stations=(
 6	["KEXP"]="https://raw.githubusercontent.com/mikepierce/internet-radio-streams/refs/heads/main/KEXP-Seattle.m3u"
 7	["NTS1"]="https://stream-relay-geo.ntslive.net/stream"
 8	["NTS2"]="https://stream-relay-geo.ntslive.net/stream2"
 9	["indiebeat-pop"]="https://azura.theindiebeat.fm/listen/the_indie_beat_radio_pop/radio.mp3"
10	["indiebeat-rock"]="https://azura.theindiebeat.fm/listen/the_indie_beat_radio_-_rock/radio.mp3"
11	["indiebeat-jazz"]="https://azura.theindiebeat.fm/listen/the_indie_beat_radio_-_jazz/radio.mp3"
12	["indiebeat-electronic"]="https://azura.theindiebeat.fm/listen/the_indie_beat_radio_-_electronic/radio.mp3"
13	["indiebeat-bonkwave"]="https://azura.theindiebeat.fm/listen/not_what_i_call_radio_bonk_wave/radio.mp3"
14	["dadradio"]="http://stacey-campbell.com:8001/dadradio.mp3"
15	["vintageobscura"]="https://radio.vintageobscura.net/stream"
16	["hbr1-tranceponder"]="https://www.hbr1.com/playlist/trance.ogg.m3u" # full-on/psychedelic
17	["hbr1-tronic"]="https://www.hbr1.com/playlist/tronic.ogg.m3u" # minimal/tech
18	["hbr1-dream"]="https://www.hbr1.com/playlist/ambient.ogg.m3u" # chillout
19)
20
21# little header text graphic to show before playback
22
23gum_echo() {
24	top=$(gum style --bold --foreground "#a6d189" --border none --width 50 --margin "1 0" --align center "♥ NOW PLAYING ♥")
25	bottom=$(gum style --foreground "#f4b8e4" --border none --width 50 --margin "1 0" --align center "$@")
26
27	joingum=$(gum join --vertical --align center "$top" "$bottom")
28	all=$(gum style --border-foreground "#99d1db" --border double --width 50 --padding "0 0" --align center "$joingum")
29
30	gum join --vertical "$all"
31}
32
33# run the script
34
35choice() {
36	choose=$(gum choose --height 20 --header "radio stations" "kexp" "nts1" "nts2" "dadradio" "indiebeat-pop" "indiebeat-rock" "indiebeat-jazz" "vintageobscura" "hbr1-tranceponder" "hbr1-tronic" "hbr1-dream")
37	case "$choose" in
38		kexp) gum_echo "KEXP" && mpv "${stations['KEXP']}";;
39		nts1) gum_echo "NTS1" && mpv "${stations['NTS1']}";;
40		nts2) gum_echo "NTS2" && mpv "${stations['NTS2']}";;
41		dadradio) gum_echo "dadradio" && mpv "${stations['dadradio']}";;
42		indiebeat-pop) gum_echo "indiebeat - pop" && mpv "${stations['indiebeat-pop']}";;
43		indiebeat-rock) gum_echo "indiebeat - rock" && mpv "${stations['indiebeat-rock']}";;
44		indiebeat-jazz) gum_echo "indiebeat - jazz" && mpv "${stations['indiebeat-jazz']}";;
45		indiebeat-electronic) gum_echo "indiebeat - electronic" && mpv "${stations['indiebeat-electronic']}";;
46		indiebeat-bonkwave) gum_echo "indiebeat -  bonkwave" && mpv "${stations['indiebeat-bonkwave']}";;
47		vintageobscura) gum_echo "vintage obscura" && mpv "${stations['vintageobscura']}";;
48		hbr1-tranceponder) gum_echo "HBR1 I.D.M. tranceponder" && mpv "${stations['hbr1-tranceponder']}";;
49		hbr1-tronic) gum_echo "HBR1 tronic lounge" && mpv "${stations['hbr1-tronic']}";;
50		hbr1-dream) gum_echo "HBR1 dream factory" && mpv "${stations['hbr1-dream']}"
51	esac
52}
53
54choice