diff --git a/.config/radio/open-fm-logo.png b/.config/radio/open-fm-logo.png new file mode 100644 index 0000000..62738b6 Binary files /dev/null and b/.config/radio/open-fm-logo.png differ diff --git a/.config/openfm_channels.json b/.config/radio/openfm_channels.json similarity index 100% rename from .config/openfm_channels.json rename to .config/radio/openfm_channels.json diff --git a/.config/radio/radio-zet-logo.png b/.config/radio/radio-zet-logo.png new file mode 100644 index 0000000..02bb2d0 Binary files /dev/null and b/.config/radio/radio-zet-logo.png differ diff --git a/.config/radio/rmf-fm-logo.png b/.config/radio/rmf-fm-logo.png new file mode 100644 index 0000000..af9d071 Binary files /dev/null and b/.config/radio/rmf-fm-logo.png differ diff --git a/.config/radio/rmf-maxxx-logo.png b/.config/radio/rmf-maxxx-logo.png new file mode 100644 index 0000000..8fb734b Binary files /dev/null and b/.config/radio/rmf-maxxx-logo.png differ diff --git a/.local/bin/scripts/play-radio b/.local/bin/scripts/play-radio index b1c8b80..2574efb 100755 --- a/.local/bin/scripts/play-radio +++ b/.local/bin/scripts/play-radio @@ -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" diff --git a/.local/bin/scripts/statusbar/sb-music b/.local/bin/scripts/statusbar/sb-music index 5f15056..14018e7 100755 --- a/.local/bin/scripts/statusbar/sb-music +++ b/.local/bin/scripts/statusbar/sb-music @@ -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"