From 298d75665a6b91453b3967fd83639f61e32c4f26 Mon Sep 17 00:00:00 2001 From: Cyril Raffatelli Date: Sun, 7 Jun 2020 15:31:39 +0200 Subject: [PATCH] Add playerctl support (#1475) --- neofetch | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neofetch b/neofetch index 44354722..3a878b5f 100755 --- a/neofetch +++ b/neofetch @@ -501,6 +501,7 @@ disk_percent="on" # mpd # muine # netease-cloud-music +# playerctl # pogo # pragha # qmmp @@ -2656,6 +2657,7 @@ get_song() { "muine" "netease-cloud-music" "plasma-browser-integration" + "playerctl" "pogo" "pragha" "qmmp" @@ -2791,6 +2793,10 @@ get_song() { awk -F'"' 'BEGIN {RS=" entry"}; /"artist"/ {a=$4} /"album"/ {b=$4} /"title"/ {t=$4} END {print a " \n" b " \n" t}')" ;; + + "playerctl"*) + song="$(playerctl metadata --format '{{ artist }} \n{{ album }} \n{{ title }}')" + ;; *) mpc &>/dev/null && song="$(mpc -f '%artist% \n%album% \n%title%' current)" || return ;; esac