27

I wish to assign Ctrl+Space to rhythmbox play/pause but cannot figure out how to do so using the keyboard menu, for whenever I try, it is disabled for i do not know what i am meant to type into the shortcut field.

0

3 Answers 3

43

What do we need...

When rhythmbox is installed, there is a command based application called rhythmbox-client that can be used to control various aspects of Rhythmbox itself.

So how does it do it...

rhythmbox-client uses a process communication protocol called DBUS. Its the same protocol that the Unity Sound Indicator menu uses.

You need to ensure that this plugin is enabled in Rhythmbox

enter image description here

How to I assign a short-cut key...

Launch Keyboard from the Unity Dash.

enter image description here

The important part is the command and assigning the short-cut itself.

The command you need to use is rhythmbox-client --play-pause

So what else can I control...

If you run rhythmbox-client --help this will give you a list of command line options which you can control Rhythmbox.

The most useful options for keyboard control are:


  --quit                                   Quit Rhythmbox
  --next                                   Jump to next song
  --previous                               Jump to previous song
  --seek                                   Seek in current track
  --play                                   Resume playback if currently paused
  --pause                                  Pause playback if currently playing
  --play-pause                             Toggle play/pause mode
  --enqueue                                Add specified tracks to the play queue
  --clear-queue                            Empty the play queue before adding new tracks
  --print-playing                          Print the title and artist of the playing song
  --print-playing-format                   Print formatted details of the song
  --set-volume                             Set the playback volume
  --volume-up                              Increase the playback volume
  --volume-down                            Decrease the playback volume
  --print-volume                           Print the current playback volume
  --set-rating                             Set the rating of the current song

There are other options which you can use in - for example - shell scripts as well.

3
1

Launch keyboard in Unity Dash Go to shortcuts

Go to Sound and Media

How it looks in 18 lts

Change the key shortcut for play/pause to Ctrl-Space (in your case). You can also change the other keys here.

As @fossfreedom stated, you can go with custom shortcuts and launch an app for it. But these multimedia keys and the way to deliver is already setup on ubuntu. No need to re-setup the rhythm-box client etc. Will save you some time :)

1
  • This didn't work for me. Rhythmbox didn't respond to the media keys. I needed to add the custom shortcut as above.
    – lobati
    Apr 5, 2022 at 17:47
1

In case anyone is seeing this at or post 2022, in Ubuntu 21.10, you can assign shortcuts to the 'Sound and Media' options which should control most players (for me, cmus, browser based sound and video, Rhythmbox, and others).

I assigned ctrl-space to the play/pause option and it's working fine!

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.