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.

ish
  • 138,666
  • 36
  • 303
  • 312
Jelle De Loecker
  • 1,279
  • 5
  • 20
  • 31
  • 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](http://askubuntu.com/q/199476/107321) instead. – tanius Jul 10 '16 at 13:49

7 Answers7

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.

nickf
  • 554
  • 6
  • 20
  • Works fine in 12.10. This is the workaround I didn't know in my answer :-) – André Stannek Oct 19 '12 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) – Eric Nemchik Apr 23 '13 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. – Mark Tomlin Apr 25 '13 at 08:12
  • Works good, just download and copy to correct directory like written in the documentation. – TIIUNDER Aug 16 '13 at 08:13
  • Spotify Gnome is **no longer needed** for Media keys to work – it should work out of the box now! From [the README](https://github.com/jreese/spotify-gnome/blob/master/README.md): "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 '16 at 13:47
11

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

Ken
  • 211
  • 2
  • 3
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.

Nik Reiman
  • 1,186
  • 1
  • 13
  • 19
  • Nik, I can confirm that this is no longer working in spotify-client-qt, which is quite sad, as it looks **so** nice. – joseeantonior May 21 '14 at 03: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 '14 at 08: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 – joseeantonior May 24 '14 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 '17 at 00: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. – Alex Burdusel Jan 24 '19 at 09:34
  • 2021, Ubuntu 20.04 LTS -- Still not working ;s – PlayHardgoPro Feb 18 '21 at 19:46
  • The answer above from Ken fixed mine problem. Apparently, when we press the multimedia butons, the Chrome intercept it and trying doing something in it. 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 – alvescleiton Jun 26 '22 at 21:20
4

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

Ryan
  • 558
  • 4
  • 12
  • 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! – Eric Nemchik Apr 23 '13 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!

scoutchorton
  • 116
  • 7
0

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

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 :-)

André Stannek
  • 4,076
  • 24
  • 40
  • 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. – Mark Tomlin Apr 25 '13 at 07:52