Page 1 of 1

HOWTO: Bind a keyboard shortcut to play/pause for spotify and similar media apps.  [Solved]

Posted: Wed May 05, 2021 2:40 pm
by frenchiveruti
Hello.
I'll post this discovery here based on this answer on reddit, to just point out that works fine on MXLinux too!

The way to make it work is quite simple, just open the Keyboard editor (The one that allows to edit the shortcuts for the system)
And inside there create a new shortcut for the following command:

Code: Select all

dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
Keep in mind that the command before is specific to spotify, you'll have to tailor it to your needs.

I bound mine to WINKEY+F1 and works perfectly and globally with no conflicts.

Hope you find the information useful, and share how you make it work for other apps (such as VLC, etc).

;)