Media Keys Don't Work

Reply

Re: Media Keys Don't Work

Rising Star 6 ArtGravity
Rising Star 6

My previous celebration apparently was premature.

I don't know why the keys worked yesterday, but they no longer work again today.

 

I guess I'm going to have to run a snap revert.

2 people liked this

Re: Media Keys Don't Work

erickfernandes
Newbie

@gumbeto wrote:

I confirm the proposed dbus command works! With that, I was able to workaround the issue by adding keybindings to the commands below.

 

Note that either `--type=method_call` or `--print-reply` is needed, otherwise the type is "signal" and it does not work (see man dbus-send). I wonder if the original problem is related to that.

 

 

dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next

 

 

The keybindings can be set in the Keyboard settings window, under Shortcuts->Custom Shortcuts:

 

spotify_workaround.pngMedia keys workaround for spotify (v > 1.0.89)

After that, click on the key-combination column and press the desired media key on the keyboard. Entering each shortcut will disable existing shortcuts with the same key (namely under "Sound and Media")



Worked for me.
I only use the media keys with Spotify so this solution is perfect.
Tanks a lot!

Highlighted

Re: Media Keys Don't Work

BlackDex
Newbie

The workaround of @gumbeto works nicely, but i wanted to make it a bit more easy to type so i created a small application which does the same. You can replace the long dbus-send commands with a shorter line.

You can use

mpris-control toggle
mpris-control next
mpris-control previous

As the commands.

Just place the mpris-control application somewhere it can be execute, like your ~/bin folder or something.

 

You can get it from here: https://github.com/BlackDex/mpris-control/releases

SUGGESTED POSTS