Skip to content

Instantly share code, notes, and snippets.

@jkpl
Created May 30, 2015 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkpl/82c4b93ccc566e74f721 to your computer and use it in GitHub Desktop.
Save jkpl/82c4b93ccc566e74f721 to your computer and use it in GitHub Desktop.
Spotify app controls in command line
#!/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