7

I was wondering whether it is possible to pause a music player (in my case Rhythmbox), by pressing a button, while the screen is locked. I would assume no, but I thought I'd ask.

A short example: If the screensaver goes on the music continues. But lets say somebody comes in my office, I don't want to type in the password, but just hit a button to pause it. And ideally of course play again once I'm alone.

Is there a program that would allow something like this? I'm using Fedora16.

Edit thanks to pbm for the solution. Here is my actkbd.conf (using Ctrl+Alt+P):

25+29+56:::su MyUserName -c "dbus-send --type=method_call  --print-reply --dest=org.gnome.UPnP.MediaServer2.Rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"
mmoya
  • 6,008
  • I find the question slightly ambiguous (as, maybe, did the previous commenter): do you want "when screensaver goes on, music pauses; when screensaver goes off, music resumes" or "screensaver goes on, but allows a certain scope of commands to be run, such as manipulating a media player" (a sort of party mode, if you will)? – Ulrich Schwarz Mar 20 '12 at 15:46
  • Okay I see why there was a confusion. I updated it with a short example which should illustrate what my question is. So yes I'm looking for a sort of "party mode". – Azrael3000 Mar 20 '12 at 15:56

1 Answers1

8

Maybe there is easier solution for this, but my first guess was to use actkbd - keyboard (but not only) shortcut daemon that works outside of X server.

In config file you can bind any keys combination to any command. More details about running actkbd you can find in this answer.

Rhythmbox can be controlled over dbus interface, so if you bind that command to some key it change your track.

dbus-send --type=method_call  --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox  /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next

To discover more dbus "commands" you can use d-feet.

pbm
  • 25,387