Skip to content

Instantly share code, notes, and snippets.

@mnlwldr
Last active October 18, 2022 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnlwldr/2ca2edb6af984ddfe4fce4785927e67e to your computer and use it in GitHub Desktop.
Save mnlwldr/2ca2edb6af984ddfe4fce4785927e67e to your computer and use it in GitHub Desktop.
somafm groovesalad cli player with time | artist - songtitle
#!/bin/sh
DEFCON="http://ice1.somafm.com/defcon-128-aac"
GROOVE="http://ice1.somafm.com/groovesalad-128-aac"
DEEP_SPACE_ONE="http://ice1.somafm.com/deepspaceone-128-aac"
COVERS="http://ice1.somafm.com/covers-128-aac"
case $1 in
"defcon") URL=$DEFCON ;;
"groove") URL=$GROOVE ;;
"space") URL=$DEEP_SPACE_ONE ;;
"covers") URL=$COVERS ;;
esac
echo "Listen to $URL"
mpv $URL 2> /dev/null | awk '/title/ { s = ""; for (i = 2; i <= NF; i++) s = s $i " "; cmd="(date +'%H:%M:%S')"; cmd | getline d; print d,"|",s; close(cmd) }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment