Created
June 9, 2013 13:22
-
-
Save jbonney/5743509 to your computer and use it in GitHub Desktop.
Spotify - Linux key bindings. From XFCE / Ubuntu keyboard shortcuts configuration, assign the control command to their key.
http://shkspr.mobi/blog/2011/12/linux-spotify-keybindings/
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
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious |
@chfritz 10x so much that helped a lot
And for anyone interested in querying the currently running song, this can be gotten from:
dbus-send --dest=org.mpris.MediaPlayer2.spotify --print-reply /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:org.mpris.MediaPlayer2.Player string:Metadata
Sample output:
method return time=1579663676.086557 sender=:1.134 -> destination=:1.420 serial=406 reply_serial=2
variant array [
dict entry(
string "mpris:trackid"
variant string "spotify:track:3d8Awbi4CFYp4Wp231MqdS"
)
dict entry(
string "mpris:length"
variant uint64 433000000
)
dict entry(
string "mpris:artUrl"
variant string "https://open.spotify.com/image/ab67616d00001e02bd3afe3a0169e70901d2933e"
)
dict entry(
string "xesam:album"
variant string "Total 7"
)
dict entry(
string "xesam:albumArtist"
variant array [
string "Various Artists"
]
)
dict entry(
string "xesam:artist"
variant array [
string "Oxia"
]
)
dict entry(
string "xesam:autoRating"
variant double 0.01
)
dict entry(
string "xesam:discNumber"
variant int32 2
)
dict entry(
string "xesam:title"
variant string "Domino"
)
dict entry(
string "xesam:trackNumber"
variant int32 11
)
dict entry(
string "xesam:url"
variant string "https://open.spotify.com/track/3d8Awbi4CFYp4Wp231MqdS"
)
]
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Seek int64:10
Find out that seek value is specified in microseconds. So you have specify int64:1000000
for 1 sec. It works for me.
This works with Spotify, but then YouTube stops working (running from Brave browser). Is there a way to keep both Spotify and YouTube?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Working great xubuntu 18.04
Thanks a lot!