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

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
User avatar
frenchiveruti
Posts: 52
Joined: Sun May 02, 2021 8:59 pm

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

#1 Post 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).

;)
Argentine 🇦🇷
- Intel P6200 | 4GB RAM | 480 Crucial BX500 SSD | MXLinux 19.4

I have stupid broadcom drivers, see how to fix here: viewtopic.php?t=64470

Return to “Tips & Tricks by users”