Update mpris plugin with cover art
This commit is contained in:
parent
8d5ee408cf
commit
0ff84042ab
5 changed files with 145 additions and 27 deletions
22
bin/get_mpris_art.sh
Executable file
22
bin/get_mpris_art.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
|
||||
read -d'\n' -ra PLAYERS <<<"$(playerctl -l 2>/dev/null)"
|
||||
declare -a PAUSED
|
||||
for player in "${PLAYERS[@]}"; do
|
||||
[ "$player" = "playerctld" ] && continue;
|
||||
|
||||
p_status=$(playerctl -p "$player" status 2>/dev/null)
|
||||
|
||||
# if we have one playing, we'll use it and EXIT
|
||||
if [ "$p_status" = "Playing" ]; then
|
||||
echo $(playerctl -p $player metadata | grep artUrl | awk '{$1=$2=""; print $0}')
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
[ "$p_status" = "Paused" ] && PAUSED+=("$player")
|
||||
done
|
||||
|
||||
# if we have a paused, show it otherwise assume there are no players or have all stopped
|
||||
if [ -n "${PAUSED[0]}" ]; then
|
||||
echo $(playerctl -p ${PAUSED[0]} metadata | grep artUrl | awk '{$1=$2=""; print $0}')
|
||||
fi
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue