16

Even though Spotify shows up in the indicator-sound just fine (Controlling it works from there) using multimedia keys on your keyboard does nothing.

When I open up Rhythmbox they're able to control the music there, so the keyboard settings seem ok.

1
  • Multimedia keys work out of the box now. If your problem is that they work but only when Spotify is the focused application, see this question instead.
    – tanius
    Jul 10, 2016 at 13:49

7 Answers 7

21

Try out Spotify Gnome

Spotify-Gnome is a program that provides Gnome media key support for the Spotify Linux client. It supports the play/pause, stop, next, and previous signals, and is compatible with both Gnome 2 and Gnome 3.

5
  • Works fine in 12.10. This is the workaround I didn't know in my answer :-) Oct 19, 2012 at 13:49
  • Working in 13.04 as of 4/23/2013 - also supports notify osd quite well, and setup was much easier than spotify-notify (mentioned below as an answer) Apr 23, 2013 at 15:08
  • It seems that a side effective is that the underlying library that is required for this serves ads. I'm currently sitting in Spotify's screen with it telling me that it can't load "onboarding-popup" once I installed this. If I had to take a guess it's a part of the gir1.2-telepathyglib-0.12 library that I had to install to get this working. Apr 25, 2013 at 8:12
  • Works good, just download and copy to correct directory like written in the documentation.
    – TIIUNDER
    Aug 16, 2013 at 8:13
  • Spotify Gnome is no longer needed for Media keys to work – it should work out of the box now! From the README: "This project is no longer required in order to use media keys with Spotify on Gnome. It will not receive any updates going forward."
    – tanius
    Jul 10, 2016 at 13:47
10

For people still having this problem: my issue was my Chrome caught all incoming media keys and so they did not reach the Spotify app. You can fix this by going to chrome://flags/#hardware-media-key-handling in the Chrome address bar and setting the Hardware Media Key Handling to Disabled

Based on https://community.spotify.com/t5/Desktop-Windows/Play-Pause-keyboard-button-doesn-t-work-on-Spotify/m-p/4730810/highlight/true#M75206

1
  • 1
    This helped me! Thanks!
    – ihoru
    Feb 2 at 8:33
7

Disclaimer: I work for Spotify

This was a known missing feature of the linux client, but we added it in version 0.9.4. So while this thread is rather old, it's worth noting that it should now work. If you continue to experience problems with the media keys, then please post a message on the community forums.

7
  • Nik, I can confirm that this is no longer working in spotify-client-qt, which is quite sad, as it looks so nice. May 21, 2014 at 3:45
  • 1
    @joseeantonior it is definitely working for me (version 0.9.10 on Ubuntu 13.10). Sometimes however they stop working, when this happens I usually restart the client and they work again. What distro are you using?
    – Nik Reiman
    May 21, 2014 at 8:18
  • They are now working. Looks like a system restart was needed for everything to work in order. I'm using Ubuntu Trusty, with Spotify version 0.9.10.17.g4129e1c9 May 24, 2014 at 21:39
  • 2
    hello, I am from the future. version 1:1.0.64.407.g9bd02c2d-26, ubuntu 16.06, those keys are not doing anything and never have. Clementine for example does fine.
    – phil294
    Oct 17, 2017 at 0:26
  • 2
    @NikReiman this isn't working even on 1.0.96.181.gf6bc1b6b on Ubuntu 16.04. I had to go with nickf's solution. Don't know what you guys fixed at Spotify, but doens't seem like you fixed this. Jan 24, 2019 at 9:34
4

You can use spotify-notify. Not only does it provide notify-osd notifications, but it also has support for media keys.

1
  • 2
    fyi the page says the author is no longer maintaining this package, and the answer above for Spotify-Gnome works just fine, is easier to install, and does everything this recommendation does - still a good find though! Apr 23, 2013 at 15:10
4

What distro/desktop environment are you using? I am on XFCE, and there is an issue with the keybinds (I believe XFCE interprets them differently than the other DE's).

I found a GitHub page giving the solution which worked for me on Ubuntu 17.04 with XFCE: https://gist.github.com/jbonney/5743509

Here is the steps (explained in a little more detail than the GitHub page):

  1. Go to Settings Manager
  2. Go to Keyboard
  3. Go to the tab labeled Application Shortcuts
  4. Click Add
  5. Based on what keybind you need to add, use these commands
    • Play/Pause: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
    • Stop: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
    • Next: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
    • Previous: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
  6. Then press corresponding key. Each key should bring up a certain code for each. They go as follows:
    • Play/Pause: XF86AudioPlay
    • Stop: XF86AudioStop
    • Next: XF86AudioNext
    • Previous: XF86AudioPrev

This should fix it! This worked for me. You may be able to skip the Stop button, and don't confuse it for the Play/Pause button. I almost did.

Like I said, I think XFCE has some issue with the keys. I think XFCE interprets XF86AudioPlay because of the XF at the beginning, and Spotify doesn't recognize it. That would make sense because it works in other DE's without issue, but XFCE breaks it without being set up. Either way, this works for me, so I hope it worked for you!

1
  • This also works on ubuntu 18.04 with lightdm
    – BenSower
    Apr 23, 2020 at 8:55
0

The mulitmedia keys have nothing to do with the sound indicator. Reactions to those keys have to be implemented in spotify itself. I don't think there is a workaround. After all the spotify linux client is still beta so there is hope that this feature will be added in a foreseeable time :-)

1
  • It worked for me just fine when I was using 12.10, when I updated to 13.04 Beta, it no longer worked. I wonder what changed to break this, or if it was a beta update that I got from Spotify that broke it. Apr 25, 2013 at 7:52
0

The latest Spotify snap version supports multimedia keys. Note: for me they started to work only after reboot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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