Update mprix and colors
This commit is contained in:
parent
b725dccade
commit
e1aa18dbed
20 changed files with 389 additions and 85 deletions
|
@ -1,3 +1,18 @@
|
|||
get_artUrl() {
|
||||
artUrl=$(playerctl -p $1 metadata | grep artUrl | awk '{$1=$2=""; print $0}')
|
||||
regex='(https?|ftp)://[-[:alnum:]\+&@#/%?=~_|!:,.;]*[-[:alnum:]\+&@#/%=~_|]'
|
||||
if [[ $artUrl =~ $regex ]]
|
||||
then
|
||||
filename=/tmp/spotify-mpris/$(basename $artUrl)
|
||||
if [ ! -f $filename ]
|
||||
then
|
||||
curl -sSL $artUrl --create-dirs -o $filename
|
||||
fi
|
||||
echo $filename
|
||||
else
|
||||
echo $artUrl
|
||||
fi
|
||||
}
|
||||
|
||||
read -d'\n' -ra PLAYERS <<<"$(playerctl -l 2>/dev/null)"
|
||||
declare -a PAUSED
|
||||
|
@ -8,7 +23,7 @@ for player in "${PLAYERS[@]}"; do
|
|||
|
||||
# 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}')
|
||||
get_artUrl $player
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
|
@ -17,6 +32,7 @@ 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}')
|
||||
get_artUrl ${PAUSED[0]}
|
||||
echo $(playerctl -p metadata | grep artUrl | awk '{$1=$2=""; print $0}')
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue