Created
August 14, 2019 12:48
-
-
Save tiagoamaro/e644b50c1a40e6615291d1c9475bc803 to your computer and use it in GitHub Desktop.
Spotify Control (Ubuntu)
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
#!/usr/bin/env bash | |
# Simple Spotify Control | |
# Just call ./spotify_control --help | |
# Source: https://community.spotify.com/t5/Desktop-Linux/Linux-keyboard-shortcuts/td-p/1626394 | |
CMD="dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player" | |
case "$1" in | |
"playpause" ) | |
${CMD}.PlayPause | |
exit $? | |
;; | |
"next" ) | |
${CMD}.Next | |
exit $? | |
;; | |
"previous" ) | |
${CMD}.Previous | |
exit $? | |
;; | |
"stop" ) | |
${CMD}.Stop | |
exit $? | |
;; | |
"play" ) | |
${CMD}.Play | |
exit $? | |
;; | |
*) | |
echo "Usage: $0 [command]" | |
echo " commands are: playpause, next, previous, stop, play" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment