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 Answers1

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

Wilf
  • 30,194
  • 17
  • 108
  • 164