Created
May 30, 2015 18:50
-
-
Save jkpl/82c4b93ccc566e74f721 to your computer and use it in GitHub Desktop.
Spotify app controls in command line
This file contains 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/bash | |
SPOTIFYCMD="dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player." | |
function spotify_oper { | |
${SPOTIFYCMD}$1 | |
} | |
case $1 in | |
"play") | |
spotify_oper "PlayPause" | |
;; | |
"stop") | |
spotify_oper "Stop" | |
;; | |
"previous") | |
spotify_oper "Previous" | |
;; | |
"next") | |
spotify_oper "Next" | |
;; | |
*) | |
echo "$0 play|pause|previous|next" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment