Unverified Commit 298d7566 authored by Cyril Raffatelli's avatar Cyril Raffatelli Committed by GitHub

Add playerctl support (#1475)

parent d14dc2d5
...@@ -501,6 +501,7 @@ disk_percent="on" ...@@ -501,6 +501,7 @@ disk_percent="on"
# mpd # mpd
# muine # muine
# netease-cloud-music # netease-cloud-music
# playerctl
# pogo # pogo
# pragha # pragha
# qmmp # qmmp
...@@ -2656,6 +2657,7 @@ get_song() { ...@@ -2656,6 +2657,7 @@ get_song() {
"muine" "muine"
"netease-cloud-music" "netease-cloud-music"
"plasma-browser-integration" "plasma-browser-integration"
"playerctl"
"pogo" "pogo"
"pragha" "pragha"
"qmmp" "qmmp"
...@@ -2791,6 +2793,10 @@ get_song() { ...@@ -2791,6 +2793,10 @@ get_song() {
awk -F'"' 'BEGIN {RS=" entry"}; /"artist"/ {a=$4} /"album"/ {b=$4} awk -F'"' 'BEGIN {RS=" entry"}; /"artist"/ {a=$4} /"album"/ {b=$4}
/"title"/ {t=$4} END {print a " \n" b " \n" t}')" /"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 ;; *) mpc &>/dev/null && song="$(mpc -f '%artist% \n%album% \n%title%' current)" || return ;;
esac esac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment