Skip to content

Instantly share code, notes, and snippets.

@perillamint
Created March 20, 2017 02:01
Show Gist options
  • Save perillamint/543567ddb297a9253b128d73ec333fee to your computer and use it in GitHub Desktop.
Save perillamint/543567ddb297a9253b128d73ec333fee to your computer and use it in GitHub Desktop.
MPRIS #NowPlaying tweet poster
#!/bin/zsh
PLAYER=Bugs
METADATA=$(qdbus org.mpris.MediaPlayer2.${PLAYER} /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata)
ALBUM=$(echo $METADATA | grep xesam:album: | sed "s/xesam:album: //g")
ARTIST=$(echo $METADATA | grep xesam:artist: | sed "s/xesam:artist: //g")
TITLE=$(echo $METADATA | grep xesam:title: | sed "s/xesam:title: //g")
TWEET="#NowPlaying ${ALBUM} - ${ARTIST} - ${TITLE}"
t update "${TWEET}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment