Created
March 20, 2017 02:01
-
-
Save perillamint/543567ddb297a9253b128d73ec333fee to your computer and use it in GitHub Desktop.
MPRIS #NowPlaying tweet poster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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