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?

Willem Van Onsem
  • 618
  • 1
  • 8
  • 18

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
  • 29,694
  • 16
  • 106
  • 164