From c59b1bfa401467dbdc7b8439cb5887e05f9ae02d Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Sun, 8 Jan 2017 15:08:03 +0100 Subject: [PATCH] Song: Add support for QuodLibet --- neofetch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index ce26bce2..964ecdb4 100755 --- a/neofetch +++ b/neofetch @@ -1205,7 +1205,7 @@ get_memory() { get_song() { # This is absurdly long. - player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|mopidy|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|xmms2d|gnome-music|lollypop|clementine|pragha|exaile|juk|bluemindo|guayadeque|yarock|qmmp/ {printf $5 " " $6; exit}')" + player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|mopidy|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|xmms2d|gnome-music|lollypop|clementine|pragha|exaile|juk|bluemindo|guayadeque|yarock|qmmp|quodlibet/ {printf $5 " " $6; exit}')" get_song_dbus() { # Multiple players use an almost identical dbus command to get the information. @@ -1269,6 +1269,11 @@ get_song() { song="$(dbus-send --print-reply --dest=org.exaile.Exaile /org/exaile/Exaile \ org.exaile.Exaile.Query | awk -F':|,' '{if ($6 && $4) printf $6 " -" $4}')" ;; + + "quodlibet"*) + 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}')" + ;; esac [[ "$(trim "$song")" = "-" ]] && unset -v song