From 424cd649fce1692cddfe9fa074ce3d88d807a1d1 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Mon, 13 Jan 2020 16:02:34 +0000 Subject: [PATCH] Optimisations to radio script --- bin/.bin/radio | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/.bin/radio b/bin/.bin/radio index 9761b459..daa68eef 100755 --- a/bin/.bin/radio +++ b/bin/.bin/radio @@ -1,6 +1,13 @@ #!/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" +# Change this if you don't want to use mpv PLAY="mpv --input-ipc-server=/tmp/mpvsocket" function getRadioStations(){ @@ -23,7 +30,7 @@ function playStation(){ if [ ! -e "$LIST" ]; then getRadioStations 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 }