2021-02-18 12:30:26 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Select internet radio station and play it in mpd.
|
|
|
|
|
2021-02-18 18:46:39 +01:00
|
|
|
OPEN_FM_CHANNELS_LIST="$HOME/.config/radio/openfm_channels.json"
|
2021-02-18 12:30:26 +01:00
|
|
|
|
|
|
|
STATIONS="$(sed 's/: .*//g; s/ /Open FM: /; s/"//g; s/}//g; s/{//g; /^$/d' "$OPEN_FM_CHANNELS_LIST")
|
|
|
|
newonce.radio
|
|
|
|
RMF FM
|
|
|
|
RMF Maxxx
|
|
|
|
Radio ZET"
|
|
|
|
|
|
|
|
station=$(echo "$STATIONS" | rofi -dmenu -i -l 20 -p ' Radio Station')
|
|
|
|
[ ! "$station" ] && exit
|
|
|
|
|
2021-02-18 18:46:39 +01:00
|
|
|
channel=""
|
|
|
|
|
2021-02-18 12:30:26 +01:00
|
|
|
case "$station" in
|
2021-02-18 18:46:39 +01:00
|
|
|
"newonce.radio")
|
|
|
|
radio="http://streamer.radio.co/s93b51ccc1/listen"
|
|
|
|
icon="newonce.radio-logo.png"
|
|
|
|
;;
|
|
|
|
"RMF FM")
|
|
|
|
radio="http://195.150.20.4:8000/rmf_fm"
|
|
|
|
icon="rmf-fm-logo.png"
|
|
|
|
;;
|
|
|
|
"RMF Maxxx")
|
|
|
|
radio="http://195.150.20.4:8000/rmf_maxxx"
|
|
|
|
icon="rmf-maxxx-logo.png"
|
|
|
|
;;
|
|
|
|
"Radio ZET")
|
|
|
|
radio="https://zt02.cdn.eurozet.pl/zet-old.mp3"
|
|
|
|
icon="radio-zet-logo.png"
|
|
|
|
;;
|
2021-02-18 12:30:26 +01:00
|
|
|
*)
|
2021-02-18 12:45:30 +01:00
|
|
|
id="$(grep "\"$(echo "$station" | sed 's/Open FM: //g')\"" "$OPEN_FM_CHANNELS_LIST" | sed 's/.*: //g; s/"//g; s/,//g')"
|
2021-02-18 12:30:26 +01:00
|
|
|
radio="http://stream.open.fm/$id"
|
2021-02-18 18:46:39 +01:00
|
|
|
icon="open-fm-logo.png"
|
|
|
|
channel="$(echo "$station" | sed 's/Open FM: //g')"
|
|
|
|
station="Open FM"
|
2021-02-18 12:30:26 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
mpc clear
|
|
|
|
mpc add "$radio"
|
|
|
|
mpc play
|
2021-02-18 18:46:39 +01:00
|
|
|
|
|
|
|
notify-send --icon "$HOME/.config/radio/$icon" "$station" "$channel"
|