local-bin/common/song

9 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}