Monday, February 13, 2012

Hotkeys for Banshee Media Player on Ubuntu without multimedia keyboard

My keyboard lacks multimedia keys. So controlling Banshee media player becomes annoying, because I have to switch to it to pause or resume playing or performing other actions on the play list currently running.
Banshee has shortcut keys for playback (space to play/pause) but the Banshee window must be active.
So here is how to make the hotkeys:

Step 1: Install CompizConfig Settings manager:
Using terminal:

sudo apt-get install compizconfig-settings-manager

Or you can install it from the software center.

Step 2: Know the actions you want to create shortcuts for:
Banshee has a command line interface. To discover the correct shortcut, we use man at terminal:
man banshee
This will let us know that, for example, the --toggle-playing option will toggle from play to pause and vice versa.

Step 3: Use CompizConfig to configure Hotkeys
Open CompizConfig, and click Commands.

In the commands tab write:

banshee --toggle-playing
In the Key Bindings tab, click one of the buttons with Disabled label that corresponds to the command line number you previously edited. In the dialog, check Enabled. Then enter the key combination of your choice.

You can add any other hotkeys for other functions as you need. And that's it.