4

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?

2
  • 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, 2012 at 11:01
  • Please edit this question to change defualt to default, doesnt to doesn't, and wanna to want to so that English translating software can work properly. Nov 27, 2021 at 22:39

2 Answers 2

4

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.

4
  • Worked fantastically in quantal as well, latest build still doesn't appear to support the media keys.
    – Aquatoad
    Apr 17, 2013 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, 2014 at 9:31
  • @edi9999 this is not the case for me. which window manager are you using?
    – Nik Reiman
    Nov 4, 2014 at 13:10
  • 1
    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, 2014 at 13:41
0

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>
      </action>
    </keybind>
    <keybind key="XF86AudioStop">
      <action name="Execute">
        <command>sp pause</command>
      </action>
    </keybind>
    <keybind key="XF86AudioNext">
      <action name="Execute">
        <command>sp next</command>
      </action>
    </keybind>
    <keybind key="XF86AudioPrev">
      <action name="Execute">
        <command>sp prev</command>
      </action>
    </keybind>
    
  3. Save the file and make your changes effective by executing:

    openbox --reconfigure
    

Sources:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .