Update radio setup - add notifications
This commit is contained in:
parent
c5e097e24e
commit
d16664fad8
BIN
.config/radio/open-fm-logo.png
Normal file
BIN
.config/radio/open-fm-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
BIN
.config/radio/radio-zet-logo.png
Normal file
BIN
.config/radio/radio-zet-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
BIN
.config/radio/rmf-fm-logo.png
Normal file
BIN
.config/radio/rmf-fm-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
BIN
.config/radio/rmf-maxxx-logo.png
Normal file
BIN
.config/radio/rmf-maxxx-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
@ -2,7 +2,7 @@
|
||||
|
||||
# Select internet radio station and play it in mpd.
|
||||
|
||||
OPEN_FM_CHANNELS_LIST="$HOME/.config/openfm_channels.json"
|
||||
OPEN_FM_CHANNELS_LIST="$HOME/.config/radio/openfm_channels.json"
|
||||
|
||||
STATIONS="$(sed 's/: .*//g; s/ /Open FM: /; s/"//g; s/}//g; s/{//g; /^$/d' "$OPEN_FM_CHANNELS_LIST")
|
||||
newonce.radio
|
||||
@ -13,17 +13,36 @@ Radio ZET"
|
||||
station=$(echo "$STATIONS" | rofi -dmenu -i -l 20 -p ' Radio Station')
|
||||
[ ! "$station" ] && exit
|
||||
|
||||
channel=""
|
||||
|
||||
case "$station" in
|
||||
"newonce.radio") radio="http://streamer.radio.co/s93b51ccc1/listen" ;;
|
||||
"RMF FM") radio="http://195.150.20.4:8000/rmf_fm" ;;
|
||||
"RMF Maxxx") radio="http://195.150.20.4:8000/rmf_maxxx" ;;
|
||||
"Radio ZET") radio="https://zt02.cdn.eurozet.pl/zet-old.mp3" ;;
|
||||
"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"
|
||||
;;
|
||||
*)
|
||||
id="$(grep "\"$(echo "$station" | sed 's/Open FM: //g')\"" "$OPEN_FM_CHANNELS_LIST" | sed 's/.*: //g; s/"//g; s/,//g')"
|
||||
radio="http://stream.open.fm/$id"
|
||||
icon="open-fm-logo.png"
|
||||
channel="$(echo "$station" | sed 's/Open FM: //g')"
|
||||
station="Open FM"
|
||||
;;
|
||||
esac
|
||||
|
||||
mpc clear
|
||||
mpc add "$radio"
|
||||
mpc play
|
||||
|
||||
notify-send --icon "$HOME/.config/radio/$icon" "$station" "$channel"
|
||||
|
@ -8,7 +8,7 @@ if playerctl --player=spotify status | grep -q "Playing"; then
|
||||
elif [ "$(mpc status | awk 'NR==2 {print $1}')" = "[playing]" ]; then
|
||||
if mpc status -f "%file%" | grep -q "open.fm"; then
|
||||
channel_id="$(mpc status -f "%name%" | awk 'NR==1 {print $1}')"
|
||||
name="$(grep \""$channel_id"\" /home/samedamci/.config/openfm_channels.json | sed 's/: .*//g; s/ //; s/"//g' | tr -d '\n')"
|
||||
name="$(grep \""$channel_id"\" "$HOME/.config/radio/openfm_channels.json" | sed 's/: .*//g; s/ //; s/"//g' | tr -d '\n')"
|
||||
printf "%s" "Open FM: $name"
|
||||
title="$(mpc status -f "%title%" | awk 'NR==1' | sed 's/ w .*//g; s/& .* -/-/g; s/feat. .* -/-/g; s/REKLAMA - open.fm - REKLAMA//g')"
|
||||
[ ! "$title" = "" ] && printf "%s" ": $title"
|
||||
|
Loading…
x
Reference in New Issue
Block a user