1

I'm trying to set my keyboard's media keys to control my command line player cmus via cmus-remote (pause, prev, next). This works fine with any other keys but the media keys will not register when I'm prompted to push the desired key for a custom shortcut. The media keys do however register just fine when I set them for one of the ubuntu default shortcuts like "play".

Is there a way to get around this limitation? I've tried to edit my dconf and set ctrl + numpad 5 to cmus-remote --pause which works great:

[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1] binding='KP_5' command='cmus-remote --pause' name='cmus pause'

Maybe it's enough to simply replace 'binding' with the media pause key? But how can I find out the name that gnome uses for that key?

xev seems to capture the media next key as 'XF86AudioNext' but setting that doesn't seem to work either.

stukev
  • 21

1 Answers1

1

I was able to fix this eventually. One big thing that apparently played into this was having to restart gnome/log out of my session after the changes.

Here's the entire rundown if you want to replicate this:

  1. Create 3 new custom commands for cmus pause/next/prev with a random shortcut.
  2. Open xev and figure out the names of the keys that you want to map to, for me they were XF86AudioPause, XF86AudioNext, XF86AudioPrev
  3. Run dconf-editor in terminal and navigate to /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/
  4. All the custom* entries are your custom shortcuts. Open them up and replace the random shortcut you set previously with the correct keys.
  5. Reboot your system.
stukev
  • 21