Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is not a question about setting up media keys, as mine have all been recognised and have their correct keysyms assigned, and I can use rhythmbox with them and other applications.

I was thinking that there must be a way to use the special XF86Audio keys (such as play, stop, next, and previous track buttons) with decibel, as most media player applications 'grab' the keys when you start the application. Some need setting up manually, but there doesn't seem to be any guides for decibel-audio-player.

Is it possible to use the appropriate laptop media keys with this player?

share|improve this question
up vote 3 down vote accepted

As long as your multimedia keys have been recognised and have their appropriate keysym assigned, the following explanation will work fine. If not, please see the Ubuntu wiki and my answer for this question.

Your 'XF86Audio' media keys (i.e. play, pause, next track, previous track buttons) usually do not work straightaway with decibel-audio-player, so you need to use the remote application, which is by default located at /usr/share/decibel-audio-player/src/ To find the valid options, just run it with python:

python /usr/share/decibel-audio-player/src/

Here is the full list of options available for the command-line application,

Command  | Arguments        | Description
next     |                  | Jump to the next track
pause    |                  | Pause or continue playing the current track
pl-add   | file1 file2...   | Append the given files to the playlist
pl-clr   |                  | Clear the playlist
pl-set   | file1 file2...   | Set the playlist to the given files
play     |                  | Start playing the current track
prev     |                  | Jump to the previous track
shuffle  |                  | Shuffle the playlist
stop     |                  | Stop playback
volume   | value (0 -- 100) | Set the volume

So, from the command-line, the python command that pause/plays a track when decibel-audio-player is already running is:

python /usr/share/decibel-audio-player/src/ pause

Other commands that can be assigned to media buttons (individually) are, for example:

python /usr/share/decibel-audio-player/src/ stop
python /usr/share/decibel-audio-player/src/ next
python /usr/share/decibel-audio-player/src/ prev

Now all you need to do is to assign the appropriate python command to the XF86 keysym that represents, for example, your play/pause on your laptop. Do this by going to shortcut settings, adding a new keyboard shortcut, then placing in the box the appropriate line above and then pressing the appropriate media key.

enter image description here

Repeat this method for however many media keys you have by using a different command and different media key every time.

When you have finished, your keyboard shortcuts application will look something like this, although I am using Xfce, so the settings section will look different for other desktop environments:

enter image description here

I thought this information was worth sharing, as I haven't been able to find any similar tutorials elsewhere, so perhaps it will be useful for someone.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.