Last active
October 18, 2022 08:49
-
-
Save mnlwldr/2ca2edb6af984ddfe4fce4785927e67e to your computer and use it in GitHub Desktop.
somafm groovesalad cli player with time | artist - songtitle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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