From 85fdd54f95600ad69fea5400afe6a2b7b3727bd7 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Tue, 27 Dec 2016 10:21:02 +0100 Subject: [PATCH 1/4] Song: Speed up Pragha song query --- neofetch | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/neofetch b/neofetch index fc273673..8e6a735b 100755 --- a/neofetch +++ b/neofetch @@ -1255,9 +1255,7 @@ get_song() { ;; "pragha"*) - artist="$(pragha -c | awk -F':' '/artist/ {print $2}')" - title="$(pragha -c | awk -F':' '/title/ {print $2}')" - song="$artist - $title" + song="$(pragha -c | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')" ;; "exaile"*) From 4b61dc1a9b2cd4c7fa32b12b299124653939aa17 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Tue, 27 Dec 2016 10:45:07 +0100 Subject: [PATCH 2/4] Song: Speed up Amarok song query --- neofetch | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 8e6a735b..e6f2ccbe 100755 --- a/neofetch +++ b/neofetch @@ -1249,9 +1249,7 @@ get_song() { ;; "amarok"*) - artist="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {print $2}')" - title="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/title/ {print $2}')" - song="$artist - $title" + song="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')" ;; "pragha"*) From 622fef77800e0e75c04a4fe5dda9c6f859bfa38f Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Tue, 27 Dec 2016 10:58:49 +0100 Subject: [PATCH 3/4] Song: Speed up Banshee song query --- neofetch | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/neofetch b/neofetch index e6f2ccbe..9fa4740e 100755 --- a/neofetch +++ b/neofetch @@ -1243,9 +1243,7 @@ get_song() { ;; "banshee"*) - artist="$(banshee --query-artist | awk -F':' '{print $2}')" - title="$(banshee --query-title | awk -F':' '{print $2}')" - song="$artist - $title" + song="$(banshee --query-artist --query-title | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')" ;; "amarok"*) From 10e3fcbd5609e88a0b4341ecfc7531b8953011ce Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Tue, 27 Dec 2016 12:28:19 +0100 Subject: [PATCH 4/4] Song: Fix cmus song query --- neofetch | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/neofetch b/neofetch index 9fa4740e..ee92cf6d 100755 --- a/neofetch +++ b/neofetch @@ -1223,9 +1223,7 @@ get_song() { "guayadeque"*) get_song_dbus "guayadeque" ;; "cmus"*) - artist="$(cmus-remote -Q | grep -F "tag artist ")" - title="$(cmus-remote -Q | grep -F "tag title")" - song="${artist/tag artist} - ${title/tag title}" + song="$(cmus-remote -Q | awk '/tag artist/ {$1=$2=""; print; print " - "} /tag title/ {$1=$2=""; print}')" ;; "spotify"*)