Add cmus support to getsong

This commit is contained in:
Dylan 2016-01-20 21:24:04 +11:00
parent a6eb4ccf91
commit 9729361a3e
1 changed files with 8 additions and 1 deletions

9
fetch
View File

@ -839,7 +839,14 @@ getmemory () {
# Get song
getsong () {
song=$(mpc current 2>/dev/null || printf "%s" "Unknown")
if type -p mpc >/dev/null 2>&1; then
song="$(mpc current)"
elif type -p cmus >/dev/null 2>&1; then
song="$(cmus-remote -Q | grep "tag artist\|title")"
song=${song/tag artist }
song=${song/tag title/-}
song=${song//[[:space:]]/ }
fi
}
# Get Resolution