From 38cb68b2dd638d59b90ffe8bb7be63c3bafeecfb Mon Sep 17 00:00:00 2001 From: dawidd6 Date: Mon, 23 Jan 2017 22:21:43 +0100 Subject: [PATCH 1/2] fix, when mpd server is on another host --- neofetch | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neofetch b/neofetch index fab4cb3a..134e62d2 100755 --- a/neofetch +++ b/neofetch @@ -1332,6 +1332,10 @@ get_song() { song="$(dbus-send --print-reply --dest=net.sacredchao.QuodLibet /net/sacredchao/QuodLibet net.sacredchao.QuodLibet.CurrentSong |\ awk -F'"' '/artist/ {getline; a=$2} /title/ {getline; t=$2} END{print a " - " t}')" ;; + + *) + if type -p mpc >/dev/null; then song="$(mpc current)"; fi + ;; esac [[ "$(trim "$song")" = "-" ]] && unset -v song From ee41671dec5507a0193e54bfe74ec8aed0b6d28d Mon Sep 17 00:00:00 2001 From: dawidd6 Date: Tue, 24 Jan 2017 00:31:53 +0100 Subject: [PATCH 2/2] rewrite mpc discovery --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 134e62d2..18175d38 100755 --- a/neofetch +++ b/neofetch @@ -1334,7 +1334,7 @@ get_song() { ;; *) - if type -p mpc >/dev/null; then song="$(mpc current)"; fi + mpc >/dev/null 2>&1 && song="$(mpc current)" ;; esac