I want to run cmus-remote --pause when I press F8 at anytime, in any window, in Ubuntu. I've tried creating a keyboard shortcut (System > Preferences > Hardware > Keyboard Shortcuts) with bash -c 'cmus-remote --pause' as the command. This doesn't work.

I got the above command from this Ask Ubuntu post: How to run a one-line bash command with a keyboard shortcut?

What am I missing? What is the proper syntax to initiate a bash command? Preferably I'd like to run this command without having bash open a new terminal.

  • Did you try to make a .sh file and then run that? – GamingWessel Jun 14 '17 at 14:15
  • Yes I tried that. The .sh files worked as ok when I ran ./pause-music.sh. But when I changed the keyboard shortcut to point to the scripts, the keyboard commands did not do anything. – reelyard Jun 14 '17 at 15:08

Your Answer

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

Browse other questions tagged or ask your own question.