From c8b41da31cdc676e1d6079a1a1a8c24137a79cac Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 16 Feb 2016 00:31:28 +1100 Subject: [PATCH] getsong, check to see if music player is running --- fetch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch b/fetch index 20565e8c..a848773e 100755 --- a/fetch +++ b/fetch @@ -1098,16 +1098,16 @@ getmemory () { # Song {{{ getsong () { - if type -p mpc >/dev/null 2>&1; then + if pgrep "mpd" >/dev/null 2>&1; then song="$(mpc current)" - elif type -p cmus >/dev/null 2>&1; then + elif pgrep "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:]]/ } - elif type -p mocp >/dev/null 2>&1; then + elif pgrep "mocp" >/dev/null 2>&1; then song="$(mocp -Q "%artist - %song")" else