I'm wondering how to bind the media keys of my laptop to cmus play/pause next/previous. I've tried to use the bind common audioplay player-pause and variance commands to simply try to do what I want.

I can't seem to figure out the correct 'key names' for the media keys, and I'm not sure if cmus will be able to understand them when running in the background. I've found fixes for OS X such as this but I see no ways to make this work on Ubuntu. Is it possible, if so, how?


cmus has remote-commands that you can assign in your keyboard shortcuts config

cmus-remote --pause   #Play/Pause
cmus-remote --next    #Next song
cmus-remote --prev    #Previous song
cmus-remote --stop    #Stop
cmus-remote --seek -5 #Rewind 5 seconds
cmus-remote --seek +5 #Forward 5 seconds


enter image description here enter image description here

I only have one problem left.

Every time I press the Audio Play key from my headphones, Ubuntu shows the notification below and the shortcut is not executed, but if I wait the notification to disappear and press it again, it works.

enter image description here

  • I had to remove the current media keys assignments and create new ones for Cmus as described in here. This answer should be accepted. :) – Petter Oct 16 at 10:48

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.