Optimisations to radio script

master
Jonathan Hodgson 5 years ago
parent ffeb3e7e74
commit 424cd649fc
  1. 9
      bin/.bin/radio

@ -1,6 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# A little script to choose and play diffenent radio stations
# Currently uses mpv to play the them
# On first run it will download a list of radio stations
# To update them run radio -u
# Change this if you want the radio stations to be saved somewhere else
LIST="$HOME/.local/share/radioStations" LIST="$HOME/.local/share/radioStations"
# Change this if you don't want to use mpv
PLAY="mpv --input-ipc-server=/tmp/mpvsocket" PLAY="mpv --input-ipc-server=/tmp/mpvsocket"
function getRadioStations(){ function getRadioStations(){
@ -23,7 +30,7 @@ function playStation(){
if [ ! -e "$LIST" ]; then if [ ! -e "$LIST" ]; then
getRadioStations getRadioStations
fi fi
cat "$LIST" | fzf --no-preview | cut -d' ' -f3 | xargs $PLAY echo -e "Name\tQuality\tURL" | cat - "$LIST" | fzf --header-lines=1 --delimiter="\t" --with-nth=1,2 --tabstop=30 --preview="echo {3}" --preview-window=top:1 | cut -d' ' -f3 | xargs -r $PLAY
} }

Loading…
Cancel
Save