23 lines
901 B
Bash
Executable file
23 lines
901 B
Bash
Executable file
#!/bin/sh
|
||
#play=$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus' | grep -o '".*"')
|
||
#if [ $(pidof spotify | wc -c) -gt 0 ]
|
||
#then
|
||
# artist="$(sp metadata | sed -n 6p | sed -E 's/artist\|//')"
|
||
# title="$(sp metadata | sed -n 9p | sed -E 's/title\|//')"
|
||
# album="$(sp metadata | sed -n 4p | sed -E 's/album\|//')"
|
||
# meta="${artist} - ${title} [${album}]"
|
||
|
||
# if [ $play == \"Paused\" ]; then
|
||
# icon=" "
|
||
# elif [ $play == \"Playing\" ]; then
|
||
# icon=" "
|
||
# else
|
||
# icon=""
|
||
# meta=""
|
||
# fi
|
||
#fi
|
||
|
||
# <200b> is the 0 width space. The trailing whitespace gets removed and idk how to prevent that, so I add a 0 width space
|
||
#echo "^c#1ED750^${icon}${meta} "
|
||
|
||
echo "$(playerctl --player=spotify metadata --format '{{ status }}: {{ artist }} - {{ title }}') "
|