9

I'm on Ubuntu 18.04 using a Das Keyboard 4. After a reboot today three of my media keys stopped working, the pause/play key and the prev/next track keys.

However, the mute key and the volume wheel still work.

I tried the following things with no success:

  • Going into the keyboards shortcuts settings and setting the keys for these shortcuts explicitly. It does seem to register the keypress but setting or clearing the shortcut doesn't help.
  • Messing around in dconf-editor per discussion in Media Keys not working on Ubuntu 17.10 - I tried clearing the setting for these shortcuts entirely and that did nothing.
  • I tried creating a custom shortcut to run dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause per that same discussion, but I cannot associate it with the pause/play key from the keyboard shortcuts app. When I try to set the shortcut for this custom command it simply doesn't register the pause/play key being pressed. If I bind it to Ctrl+Alt+Shift+P it does work (but I want my media keys!).

This is incredibly annoying. If anyone has any idea how to fix it I'd be greatly appreciative.

12
  • Does this happen all the time? Was Chrome open when you were experiencing this?
    – rtaft
    Jun 17 '19 at 13:29
  • @rtaft - yes, this happens all the time. I've rebooted multiple times and tried to use set and use the play/pause after logging in but it does not work. Jun 24 '19 at 1:07
  • Did you try a cold boot? Jun 24 '19 at 1:47
  • Are events from the keyboard still arriving? Can you check with something like xev? Jun 25 '19 at 16:30
  • @SebastianStark - yes, I see the events in xev. I can even set the keys as a shortcut in the gnome keyboard settings applet but the play/pause doesn't work once it's set. Jun 25 '19 at 21:54
5
+100

Do the following:

gsettings set org.gnome.settings-daemon.plugins.media-keys previous ''
gsettings set org.gnome.settings-daemon.plugins.media-keys next ''
gsettings set org.gnome.settings-daemon.plugins.media-keys volume-mute ''

and then try again as the keys won't be trapped any more so Gnome can do whatever it wants with them.

If one of the keys stops working, rebind it in Keyboard settings.

7
  • That did it! Thanks! Jul 1 '19 at 3:07
  • Although I should note that my prev, next, and mute keys had kept working. This broke them but fixed play/pause. Then I went back into the keyboard settings and rebound the prev, next, & mute keys and now it all works. WTF, gnome. Jul 1 '19 at 3:09
  • That's why I wanted you in chat. @DaveRolsky :-) Happy to help, thanks for the upvote and acceptance, don't forget to award the bounty as otherwise I only get half. ;-)
    – Fabby
    Jul 1 '19 at 7:55
  • So play/pause has stopped working again after a recent reboot and now this fix no longer solves it. Why, gnome, why? Sep 3 '19 at 14:26
  • And now it's working again after yet another reboot. W. T. F. Sep 3 '19 at 14:45
2

Here's my solution on Ubuntu 19.10 with media keys working after a clean reboot, but not after resuming from sleep, etc.

Restarting gsd-media-keys in Terminal:

killall gsd-media-keys
/usr/lib/gnome-settings-daemon/gsd-media-keys

You might want to run the latter command with the run dialog (Alt + F2) because it will start in the foreground.

1
  • Would be cleaner with a systemctl restart --user gsd-media-keys kind of command but couldn't get it working since it's only started via dependencies.
    – luopio
    Apr 21 '20 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.