Adds mpv radio block

This commit is contained in:
Jonathan Hodgson 2018-12-11 18:48:46 +00:00
parent c1dd29f84d
commit 2afb901060
3 changed files with 29 additions and 7 deletions

View file

@ -10,16 +10,16 @@ case $BLOCK_BUTTON in
esac
if [ "$($COMMAND status)" = "Playing" ]; then
if [ "$($COMMAND status 2> /dev/null )" = "Playing" ]; then
colour="#00FF00"
else
colour="#FF8000"
fi
title=$($COMMAND metadata title | sed "s/\&/\&/g")
artist=$($COMMAND metadata artist | sed "s/\&/\&/g")
title=$($COMMAND metadata title 2> /dev/null | sed "s/\&/\&/g")
artist=$($COMMAND metadata artist 2> /dev/null | sed "s/\&/\&/g")
if [ "$title" != "(null)" ]; then
if [ "$title" != "" ]; then
ret="<span foreground='$colour'>$title</span>"
if [ -n "$artist" ]; then
ret="$ret - $artist"
@ -28,5 +28,3 @@ if [ "$title" != "(null)" ]; then
echo "$ret";
fi