Last active
September 23, 2016 21:03
-
-
Save Ohcanep/8baf722267833192e988be176fdb4952 to your computer and use it in GitHub Desktop.
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 | |
# For a vastly more feature-rich tool, have a look at | |
# https://gist.github.com/Ohcanep/48dac84c5916821d150c545a6eb12547 | |
# https://gist.github.com/wandernauta/6800547 (original) | |
DEST="org.mpris.MediaPlayer2.spotify" | |
OBJECT_PATH="/org/mpris/MediaPlayer2" | |
INTERFACE="org.mpris.MediaPlayer2.Player" | |
dbus_send_spotify () | |
{ | |
dbus-send --dest="$DEST" --type=method_call "$OBJECT_PATH" "$INTERFACE"."$1" | |
} | |
case "$1" in | |
play) | |
dbus_send_spotify PlayPause;; | |
stop) | |
dbus_send_spotify Stop;; | |
prev) | |
dbus_send_spotify Previous;; | |
next) | |
dbus_send_spotify Next;; | |
*) | |
echo "Usage: $0 play|stop|prev|next" | |
exit 1;; | |
esac |
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 | |
xfconf_set_shortcut () | |
{ | |
xfconf-query --channel xfce4-keyboard-shortcuts \ | |
--create --property "/commands/custom/$1" --type string --set "$2" | |
} | |
xfconf_set_shortcut "XF86AudioPlay" "spotify-ctrl play" | |
xfconf_set_shortcut "XF86AudioStop" "spotify-ctrl stop" | |
xfconf_set_shortcut "XF86AudioPrev" "spotify-ctrl prev" | |
xfconf_set_shortcut "XF86AudioNext" "spotify-ctrl next" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment