From cfd5a73db9424da8a0db5e01125823c29b960f83 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Wed, 4 Jan 2017 17:07:35 +0100 Subject: [PATCH 1/4] Song: Add support for Yarock --- neofetch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index ba50c2b0..a8851fb9 100755 --- a/neofetch +++ b/neofetch @@ -1202,7 +1202,7 @@ get_memory() { get_song() { # This is absurdly long. - player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|xmms2d|gnome-music|lollypop|clementine|pragha|exaile|juk|bluemindo|guayadeque/ {printf $5 " " $6; exit}')" + player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|xmms2d|gnome-music|lollypop|clementine|pragha|exaile|juk|bluemindo|guayadeque|yarock/ {printf $5 " " $6; exit}')" get_song_dbus() { # Multiple players use an almost identical dbus command to get the information. @@ -1229,6 +1229,7 @@ get_song() { "juk"*) get_song_dbus "juk" ;; "bluemindo"*) get_song_dbus "Bluemindo" ;; "guayadeque"*) get_song_dbus "guayadeque" ;; + "yarock"*) get_song_dbus "yarock" ;; "cmus"*) song="$(cmus-remote -Q | awk '/tag artist/ {$1=$2=""; print; print " - "} /tag title/ {$1=$2=""; print}')" From 286b343a89d86d87fa2070415e825e62142ff6d2 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Wed, 4 Jan 2017 17:40:20 +0100 Subject: [PATCH 2/4] Song: Add support for Qmmp --- neofetch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index a8851fb9..da1b95ad 100755 --- a/neofetch +++ b/neofetch @@ -1202,7 +1202,7 @@ get_memory() { get_song() { # This is absurdly long. - player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|xmms2d|gnome-music|lollypop|clementine|pragha|exaile|juk|bluemindo|guayadeque|yarock/ {printf $5 " " $6; exit}')" + player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|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}')" get_song_dbus() { # Multiple players use an almost identical dbus command to get the information. @@ -1223,6 +1223,7 @@ get_song() { "deadbeef"*) song="$(deadbeef --nowplaying '%a - %t')" ;; "audacious"*) song="$(audtool current-song)" ;; "xmms2d"*) song="$(xmms2 current -f '${artist} - ${title}')" ;; + "qmmp"*) song="$(qmmp --nowplaying '%p - %t')" ;; "gnome-music"*) get_song_dbus "GnomeMusic" ;; "lollypop"*) get_song_dbus "Lollypop" ;; "clementine"*) get_song_dbus "clementine" ;; From 8e32dc78f7e803e089aeec35bf43b6ef59d83d4e Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Thu, 5 Jan 2017 14:50:39 +0100 Subject: [PATCH 3/4] Song: Don't print empty song generally --- neofetch | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index da1b95ad..f22352f8 100755 --- a/neofetch +++ b/neofetch @@ -1251,15 +1251,15 @@ get_song() { ;; "banshee"*) - song="$(banshee --query-artist --query-title | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')" + song="$(banshee --query-artist --query-title | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{print a " - " t}')" ;; "amarok"*) - song="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')" + song="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{print a " - " t}')" ;; "pragha"*) - song="$(pragha -c | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')" + song="$(pragha -c | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{print a " - " t}')" ;; "exaile"*) @@ -1268,6 +1268,8 @@ get_song() { ;; esac + [[ "$(trim "$song")" = "-" ]] && unset -v song + # Display Artist and Title on separate lines. if [[ "$song_shorthand" == "on" ]]; then artist="${song/ -*}" From 4b1b77bfca6002ed519ed960356a5331b440b44d Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Thu, 5 Jan 2017 16:11:38 +0100 Subject: [PATCH 4/4] Song: [deadbeef] Don't use deprecated --nowplaying --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index f22352f8..8cb30c20 100755 --- a/neofetch +++ b/neofetch @@ -1220,7 +1220,7 @@ get_song() { "mocp"*) song="$(mocp -Q "%artist - %song")" ;; "google play"*) song="$(gpmdp-remote current)" ;; "rhythmbox"*) song="$(rhythmbox-client --print-playing)" ;; - "deadbeef"*) song="$(deadbeef --nowplaying '%a - %t')" ;; + "deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist% - %title%')" ;; "audacious"*) song="$(audtool current-song)" ;; "xmms2d"*) song="$(xmms2 current -f '${artist} - ${title}')" ;; "qmmp"*) song="$(qmmp --nowplaying '%p - %t')" ;;