scripts/dwm/spotify.sh
2022-12-28 16:44:03 -05:00

23 lines
901 B
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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 }}') "