Create Global Shortcut Keys for Rhythmbox Music Player in Any Desktop


I use Rhythmbox as my primary music player in Ubuntu Linux, but a few months ago I switched from GNOME desktop to KDE. Since Rhythmbox is a GNOME-style program I couldn't find an easy way to setup global hotkeys in the KDE desktop that send commands like Pause and Play to the running instance of Rhythmbox. The command-line tool "rhythmbox-client" provides a solution:

Create a launcher anywhere in your desktop's menu system that runs the command you want, for example

rhythmbox-client --play-pause

And then assign a global shortcut key to that launcher, for example Ctrl+Alt+\.

Here is a list of all the commands rhythmbox-client supports:

--quit Quit Rhythmbox
--no-present Don't present an existing Rhythmbox window
--hide Hide the Rhythmbox window
--next Jump to next song
--previous Jump to previous song
--notify Show notification of the playing song
--play Resume playback if currently paused
--pause Pause playback if currently playing
--play-pause Toggle play/pause mode
--play-uri=URI to play Play a specified URI, importing it if necessary
--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
--mute Mute playback
--unmute Unmute playback

Note that the launcher you create will probably NOT open a terminal by default, so any output that might result from your Rhythmbox command (from the "--print-playing" command, for example) will probably be lost.


Add Comment

* Required information
Powered by Commentics

Comments (2)

This was spot on. Thank-You, I simply put this in as custom shortcuts in the system settings with a hotkey... ty sir.

Hi there!
I did it and what happened was weird! I typed "$ rhythmbox-client --next" and the system asked me to type new command and I did Ctrl+ β†’, then, $ rhythmbox-client --previous and I typed Ctrl+ ← in order to change old defaut commands Alt+ β†’ to play next song and Alt+ ← for previous. I have installed both Rhythmbox and Banshee for different uses, and now when I type Ctrl+ β†’ or Ctrl+ ←, it executes Banshee! It doesn't make sense for me, however my question is: How can I set the default settings again? I mean by type Ctrl+ β†’ or Ctrl+ ← without executing Banshee?

Thanks in advance.