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

I've added spotify preview as my defualt music program, by doing this.

As doug suggested, simply add this line to your >~/.local/share/applications/mimeapps.list file in two places, like so:

[Default Applications] ... audio/x-vorbis+ogg=spotify.desktop

[Added Associations] ... audio/x-vorbis+ogg=spotify.desktop;

But the media buttons doesnt seem to wanna work. Is there any easy known way to fix this without binding special keys etc perhaps?

share|improve this question
Which computer are you using? Is it a laptop or a desktop? If it's a laptop please provide the model, if it's a desktop, please provide the keyboard model/ – Томица Кораћ Oct 13 '12 at 11:01

This is a known issue with the Spotify Linux client. It's something that the company is aware of, but in the meantime you can use the Spotify Gnome Integration software to get the media keys working.

Edit: Hooray, we added this feature in client version 0.9.4! It should now work, if it doesn't then please post a message on the community forums.

share|improve this answer
Worked fantastically in quantal as well, latest build still doesn't appear to support the media keys. – Aquatoad Apr 17 '13 at 21:51
It seems that the media keys work if the client is in the focused, but not when you're in an other program, which is annoying – edi9999 Nov 4 '14 at 9:31
@edi9999 this is not the case for me. which window manager are you using? – Nik Reiman Nov 4 '14 at 13:10
I'm using spotify v0.9.10 and the X window manager. It works now thanks to the dbus command with custom keyboard shortcuts – edi9999 Nov 4 '14 at 13:41

The keyboard's media keys (means the "XF86Audio*" keys, usually Fn + Arrows) work in Spotify out of the box now – but depending on your desktop environment and configuration, maybe only if Spotify has the keyboard focus. Sometimes, a solution is to make Spotify the default music application, but there are alternatives:

Solution for Lubuntu / LXDE / OpenBox

The following configures the media keys as global keyboard shortcuts that always control Spotify:

  1. Install the Spotify command line client sp, a small bash script controlling Spotify via DBUS: just save the sp file as /usr/local/bin/sp and make it executable.

  2. Open ~/.config/opebox/lubuntu-rc.xml and somewhere between <keyboard>…</keyboard>, add:

    <keybind key="XF86AudioPlay">
      <action name="Execute">
        <command>sp play</command>
    <keybind key="XF86AudioStop">
      <action name="Execute">
        <command>sp pause</command>
    <keybind key="XF86AudioNext">
      <action name="Execute">
        <command>sp next</command>
    <keybind key="XF86AudioPrev">
      <action name="Execute">
        <command>sp prev</command>
  3. Save the file and make your changes effective by executing:

    openbox --reconfigure


share|improve this answer

Your Answer


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

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