diff --git a/nowplaying.sh b/nowplaying.sh index cc202a9..eb8b188 100755 --- a/nowplaying.sh +++ b/nowplaying.sh @@ -1,8 +1,17 @@ #!/bin/bash -s=$( playerctl -f '{{trunc(xesam:artist, 20)}} - {{trunc(xesam:title, 30)}}' metadata ) -if [ $? -eq 0 ]; then - echo "$s" +stat=$( playerctl status ) +msg=$( playerctl -f '{{trunc(xesam:artist, 15)}} - {{trunc(xesam:title, 30)}}' metadata ) +if [ "$stat" = "Playing" ]; then + if [ "$msg" = " - " ]; then + echo "No metadata" + else + echo "$msg" + fi else - echo "" + if [ "$stat" = "Paused" ]; then + echo "Paused" + else + echo "" + fi fi exit 0