Merge pull request #262 from iandrewt/cmus-fix

fixed song output for cmus
This commit is contained in:
Dylan Araps 2016-05-23 21:19:37 +10:00
commit 083b791e4a
1 changed files with 4 additions and 3 deletions

View File

@ -1446,9 +1446,10 @@ getsong () {
elif [ -n "$(ps x | awk '!(/awk/) && /cmus/')" ]; then
song="$(cmus-remote -Q | grep "tag artist \|title" 2>/dev/null)"
song=${song/tag artist }
song=${song/tag title/-}
song=${song//[[:space:]]/ }
artist="${song##*tag artist }"
title="${song##*tag title }"
title="${title%%tag artist*}"
song="$artist - $title"
state=$(cmus-remote -Q | awk -F ' ' '/status/ {printf $2}' 2>/dev/null)
elif pgrep "mocp" >/dev/null 2>&1; then