From 9729361a3e65d497f1cbf46cd6543cbc45c6f866 Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 20 Jan 2016 21:24:04 +1100 Subject: [PATCH] Add cmus support to getsong --- fetch | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fetch b/fetch index 2738e5ba..e43ab417 100755 --- a/fetch +++ b/fetch @@ -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