Add playerctl support (#1475)

This commit is contained in:
Cyril Raffatelli 2020-06-07 15:31:39 +02:00 committed by GitHub
parent d14dc2d54f
commit 298d75665a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"
@ -2792,6 +2794,10 @@ get_song() {
/"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