3

One can configure the play/pause key on his/her keyboard to start/pause music of any music player that supports this function.

I'm writing a program that should trigger these events. Currently the program calls:

rhythmbox-client --play

To start playing music. The problem with this approach is that the user for instance can use Nuvola player.

How can I trigger a play/pause event?

1 Answer 1

5

Just tried this... Run:

xdotool key XF86AudioPlay

This just simulates the pressing of the keyboard's Play button - (In my case Fn+F9)

You may need to install Xdotool first - this might work... For the program you are making, it could be installed as dependencies.

For more commands see here

1
  • This link for Xdotool might work as well...
    – Wilf
    Dec 11, 2013 at 22:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .