local-bin/common/song

8 lines
323 B
Bash
Executable file

#!/bin/sh
player="spotifyd"
qdbus org.mpris.MediaPlayer2.$player /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata >/tmp/currentsong
artist=$(cat /tmp/currentsong | grep "xesam:artist" | sed 's/.*artist: //')
title=$(cat /tmp/currentsong | grep "xesam:title" | sed 's/.*title: //')
echo ${artist} - ${title}