|
|
@ -1,5 +1,8 @@ |
|
|
|
#!/usr/bin/env zsh |
|
|
|
set -eu |
|
|
|
if hash clementine 2>/dev/null && pgrep clementine > /dev/null; then |
|
|
|
ARTIST=$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep 'xesam:artist: ' | cut -c15-) |
|
|
|
TITLE=$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep 'xesam:title: ' | cut -c14-) |
|
|
|
echo "$ARTIST - $TITLE" |
|
|
|
COMBINED="$ARTIST - $TITLE" |
|
|
|
echo ${COMBINED:0:40} |
|
|
|
fi |