Adds mpv radio block
This commit is contained in:
parent
c1dd29f84d
commit
2afb901060
3 changed files with 29 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue