Media Keys not working on Ubuntu 17.10












5















I'm running a pretty-much brand-new Ubuntu 17.10 installation on a Thinkpad T470s.



Whenever I'm hitting one of the media keys (play/pause, skip, etc) on any one of my keyboards or bluetooth-headset I'm seeing this icon:



popup on media key indicating no action allowed



flash on the monitor but none of my media players react.



The keys are recognized in showkey:



~$ sudo showkey -k
press any key (program terminates 10s after last keypress)...
keycode 163 press
keycode 163 release
keycode 165 press
keycode 165 release
keycode 164 press
keycode 164 release


But they don't show up in xev.










share|improve this question

























  • I have a similar issue. Except that it was working before I reinstalled the new Kubuntu 17.10.1

    – insidesin
    Jan 22 '18 at 23:43













  • Does pulseaudio in your terminal give any scary message? Does adding swh-plugins help?

    – covener
    Feb 16 '18 at 2:26











  • This symbol means that the desktop environment recognises the media key but no application registered itself as a media command user. Which media player(s) do/did you have running (at the time)? You can also take a look at the keyboard shortcut mappings of GNOME in gnome-control-center keyboard shortcuts.

    – David Foerster
    Feb 21 '18 at 14:06













  • I wanted to control kodi with a mx3 air mouse. In gnome-control-center I disbaled the media keys for play/play pause/next/previous and now I can use them in kodi. But the fast foward and fast backward do not work, here the icon above comes and I cannot see where I can disable them in the gnome-control-center.

    – jms
    Apr 26 '18 at 6:51
















5















I'm running a pretty-much brand-new Ubuntu 17.10 installation on a Thinkpad T470s.



Whenever I'm hitting one of the media keys (play/pause, skip, etc) on any one of my keyboards or bluetooth-headset I'm seeing this icon:



popup on media key indicating no action allowed



flash on the monitor but none of my media players react.



The keys are recognized in showkey:



~$ sudo showkey -k
press any key (program terminates 10s after last keypress)...
keycode 163 press
keycode 163 release
keycode 165 press
keycode 165 release
keycode 164 press
keycode 164 release


But they don't show up in xev.










share|improve this question

























  • I have a similar issue. Except that it was working before I reinstalled the new Kubuntu 17.10.1

    – insidesin
    Jan 22 '18 at 23:43













  • Does pulseaudio in your terminal give any scary message? Does adding swh-plugins help?

    – covener
    Feb 16 '18 at 2:26











  • This symbol means that the desktop environment recognises the media key but no application registered itself as a media command user. Which media player(s) do/did you have running (at the time)? You can also take a look at the keyboard shortcut mappings of GNOME in gnome-control-center keyboard shortcuts.

    – David Foerster
    Feb 21 '18 at 14:06













  • I wanted to control kodi with a mx3 air mouse. In gnome-control-center I disbaled the media keys for play/play pause/next/previous and now I can use them in kodi. But the fast foward and fast backward do not work, here the icon above comes and I cannot see where I can disable them in the gnome-control-center.

    – jms
    Apr 26 '18 at 6:51














5












5








5


4






I'm running a pretty-much brand-new Ubuntu 17.10 installation on a Thinkpad T470s.



Whenever I'm hitting one of the media keys (play/pause, skip, etc) on any one of my keyboards or bluetooth-headset I'm seeing this icon:



popup on media key indicating no action allowed



flash on the monitor but none of my media players react.



The keys are recognized in showkey:



~$ sudo showkey -k
press any key (program terminates 10s after last keypress)...
keycode 163 press
keycode 163 release
keycode 165 press
keycode 165 release
keycode 164 press
keycode 164 release


But they don't show up in xev.










share|improve this question
















I'm running a pretty-much brand-new Ubuntu 17.10 installation on a Thinkpad T470s.



Whenever I'm hitting one of the media keys (play/pause, skip, etc) on any one of my keyboards or bluetooth-headset I'm seeing this icon:



popup on media key indicating no action allowed



flash on the monitor but none of my media players react.



The keys are recognized in showkey:



~$ sudo showkey -k
press any key (program terminates 10s after last keypress)...
keycode 163 press
keycode 163 release
keycode 165 press
keycode 165 release
keycode 164 press
keycode 164 release


But they don't show up in xev.







keyboard shortcut-keys 17.10 media-buttons






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 19 '18 at 11:49









k0pernikus

2,98763163




2,98763163










asked Dec 28 '17 at 16:42









Nils BorrmannNils Borrmann

2615




2615













  • I have a similar issue. Except that it was working before I reinstalled the new Kubuntu 17.10.1

    – insidesin
    Jan 22 '18 at 23:43













  • Does pulseaudio in your terminal give any scary message? Does adding swh-plugins help?

    – covener
    Feb 16 '18 at 2:26











  • This symbol means that the desktop environment recognises the media key but no application registered itself as a media command user. Which media player(s) do/did you have running (at the time)? You can also take a look at the keyboard shortcut mappings of GNOME in gnome-control-center keyboard shortcuts.

    – David Foerster
    Feb 21 '18 at 14:06













  • I wanted to control kodi with a mx3 air mouse. In gnome-control-center I disbaled the media keys for play/play pause/next/previous and now I can use them in kodi. But the fast foward and fast backward do not work, here the icon above comes and I cannot see where I can disable them in the gnome-control-center.

    – jms
    Apr 26 '18 at 6:51



















  • I have a similar issue. Except that it was working before I reinstalled the new Kubuntu 17.10.1

    – insidesin
    Jan 22 '18 at 23:43













  • Does pulseaudio in your terminal give any scary message? Does adding swh-plugins help?

    – covener
    Feb 16 '18 at 2:26











  • This symbol means that the desktop environment recognises the media key but no application registered itself as a media command user. Which media player(s) do/did you have running (at the time)? You can also take a look at the keyboard shortcut mappings of GNOME in gnome-control-center keyboard shortcuts.

    – David Foerster
    Feb 21 '18 at 14:06













  • I wanted to control kodi with a mx3 air mouse. In gnome-control-center I disbaled the media keys for play/play pause/next/previous and now I can use them in kodi. But the fast foward and fast backward do not work, here the icon above comes and I cannot see where I can disable them in the gnome-control-center.

    – jms
    Apr 26 '18 at 6:51

















I have a similar issue. Except that it was working before I reinstalled the new Kubuntu 17.10.1

– insidesin
Jan 22 '18 at 23:43







I have a similar issue. Except that it was working before I reinstalled the new Kubuntu 17.10.1

– insidesin
Jan 22 '18 at 23:43















Does pulseaudio in your terminal give any scary message? Does adding swh-plugins help?

– covener
Feb 16 '18 at 2:26





Does pulseaudio in your terminal give any scary message? Does adding swh-plugins help?

– covener
Feb 16 '18 at 2:26













This symbol means that the desktop environment recognises the media key but no application registered itself as a media command user. Which media player(s) do/did you have running (at the time)? You can also take a look at the keyboard shortcut mappings of GNOME in gnome-control-center keyboard shortcuts.

– David Foerster
Feb 21 '18 at 14:06







This symbol means that the desktop environment recognises the media key but no application registered itself as a media command user. Which media player(s) do/did you have running (at the time)? You can also take a look at the keyboard shortcut mappings of GNOME in gnome-control-center keyboard shortcuts.

– David Foerster
Feb 21 '18 at 14:06















I wanted to control kodi with a mx3 air mouse. In gnome-control-center I disbaled the media keys for play/play pause/next/previous and now I can use them in kodi. But the fast foward and fast backward do not work, here the icon above comes and I cannot see where I can disable them in the gnome-control-center.

– jms
Apr 26 '18 at 6:51





I wanted to control kodi with a mx3 air mouse. In gnome-control-center I disbaled the media keys for play/play pause/next/previous and now I can use them in kodi. But the fast foward and fast backward do not work, here the icon above comes and I cannot see where I can disable them in the gnome-control-center.

– jms
Apr 26 '18 at 6:51










6 Answers
6






active

oldest

votes


















8














I recently faced the same issue and after losing a LOT of time I found an answer on some Arch forum.



This whole issue looks like 'it's not a bug, it's a FEATURE' present from Gnome devs.



In short: when you press a media button it generates a keycode which is then translated into a command. Let's say you press a Play/Pause button. It generates a keycode 162 and a command XF86AudioPlay.



Now almost every media application that may be waiting for this event (be it VLC, totem, kodi, spotify etc.) expect to receive pure XF86AudioPlay command. And what Gnome does? It intercepts this command and translate it into it's own command "play". Because of this neither xev nor xbindkeys show this event properly - they never receive a command they can understand.



When you press a media button Gnome receives the command and checks if there is any app that its recognized as capable of receiving this command. If there is (let's say totem, rhytmbox, maybe VLC) it sends "play" that should work. If there is no app recognised as capable of receiving this command Gnome will show the sign that is attached to first post and won't send any command anywhere.



The solution is simple - make Gnome unable to intercept media key events. Install dconf-editor , go to org.gnome.settings-daemon.plugins.media-keys and change any button that should work from XF86SomeExapmle to none (''). This way any app should receive key command directly.






share|improve this answer



















  • 1





    This works great. If you disable Play/Pause in Gnome Settings-Keyboard-Media Keys, Kodi can use it. But for fast forward and fast backward, still the "not-works" symbol from above appears but I do not know what to disable. Fast FF/BW ist not mentioned in the media keys.

    – jms
    Apr 22 '18 at 21:04











  • This was the secret sauce I needed. This, plus a combination of playerctl and xbindkeys and now my keyboard can control all my players, not just Rhythmbox.

    – Adrian
    Dec 24 '18 at 15:51











  • I also restarted after making these changes (logging in and out is likely enough) to make them work

    – Salami
    Jan 4 at 2:30



















5














If the keyboard media keys do not work from your Ubuntu desktop, you can use D-Bus support to send the proper commands to Spotify. Validate the following commands from the console:



Play/Pause



dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause



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



Enable Media Key Shortcut



To tie these to the keyboard, go to Settings > Keyboard > Shortcuts > Custom Shortcuts, then “Add”. Use one of the command above, then hit the key that you want to tie to the new command.



Source



https://fabianlee.org/2016/05/25/ubuntu-enabling-media-keys-for-spotify/






share|improve this answer
























  • Excellent, this is exactly what I was looking for. Many thanks!

    – Josh Crozier
    Nov 3 '18 at 16:23











  • This worked for me in Ubuntu 14.04, except I use Compiz so I had to use the CompizConfig Settings Manager "Commands" applet to assign the shortcuts.

    – Tyler Collier
    Dec 15 '18 at 22:49



















2














combination of last two answers works for me. I have Ubuntu 18.04 the keyboard test work



~$ sudo showkey -k
press any key (program terminates 10s after last keypress)...
keycode 163 press
keycode 163 release
keycode 165 press
keycode 165 release
keycode 164 press
keycode 164 release


but when I go to Activities -> Keyboard and try to do anything with Play / Next / Previous it not work at all. When I deactivated default key association (invoke dialog for key association, press backspace and click save) and create brand new one it works, very helpful was answer from @foamboarder



now it looks like this screenshot from shortcut setup all works fine now even after wake up the computer from sleep mode






share|improve this answer
























  • +1 because this eventually worked for me, but you should have included the commands you used in the custom keyboard shortcuts: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause and ...Previous and ...Next

    – bitinerant
    Feb 28 at 8:38



















0














Using the above answer by @Václav worked for me on Ubuntu 18.04, where he said




"... deactivated default key association (invoke dialog for key association, press backspace and click save) and create brand new one".




I use Rhythmbox, here are the commands I was putting for each Custom Shorcut for Rhythmbox:



For Previous:



`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous`  


For Next:



`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next`  


For Play/Stop:



`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause`  


Hope this helps someone one day






share|improve this answer
























  • I installed playerctl and it can find and control most of the media players I use automatically.

    – Adrian
    Dec 24 '18 at 15:53



















0














I found that, with Ubuntu 18.04 LTS as of 2019/2/1, all I needed to do was:




  • install dconf-editor

  • navigate to org/gnome/settings-daemon/plugins/media-keys

  • for each key not working:


    • uncheck "Use default value"

    • hit apply

    • re-check "Use default value"

    • hit apply again




Media keys in question should now work immediately.



Using no value, as per darkdude recommended, didn't work for me.






share|improve this answer































    -1














    The key-codes seem not to be mapped accordingly.
    You can manually map keys as described in the ubuntu documentation:
    https://help.ubuntu.com/stable/ubuntu-help/keyboard-shortcuts-set.html




    1. Open the Activities overview and start typing Keyboard.

    2. Click on Keyboard to open the panel.

    3. Select the Shortcuts tab.

    4. Select a category in the left pane, and the row for the desired action on the right. The current shortcut definition will change to New accelerator…

    5. Hold down the desired key combination, or press Backspace to clear.






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f990284%2fmedia-keys-not-working-on-ubuntu-17-10%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      6 Answers
      6






      active

      oldest

      votes








      6 Answers
      6






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      8














      I recently faced the same issue and after losing a LOT of time I found an answer on some Arch forum.



      This whole issue looks like 'it's not a bug, it's a FEATURE' present from Gnome devs.



      In short: when you press a media button it generates a keycode which is then translated into a command. Let's say you press a Play/Pause button. It generates a keycode 162 and a command XF86AudioPlay.



      Now almost every media application that may be waiting for this event (be it VLC, totem, kodi, spotify etc.) expect to receive pure XF86AudioPlay command. And what Gnome does? It intercepts this command and translate it into it's own command "play". Because of this neither xev nor xbindkeys show this event properly - they never receive a command they can understand.



      When you press a media button Gnome receives the command and checks if there is any app that its recognized as capable of receiving this command. If there is (let's say totem, rhytmbox, maybe VLC) it sends "play" that should work. If there is no app recognised as capable of receiving this command Gnome will show the sign that is attached to first post and won't send any command anywhere.



      The solution is simple - make Gnome unable to intercept media key events. Install dconf-editor , go to org.gnome.settings-daemon.plugins.media-keys and change any button that should work from XF86SomeExapmle to none (''). This way any app should receive key command directly.






      share|improve this answer



















      • 1





        This works great. If you disable Play/Pause in Gnome Settings-Keyboard-Media Keys, Kodi can use it. But for fast forward and fast backward, still the "not-works" symbol from above appears but I do not know what to disable. Fast FF/BW ist not mentioned in the media keys.

        – jms
        Apr 22 '18 at 21:04











      • This was the secret sauce I needed. This, plus a combination of playerctl and xbindkeys and now my keyboard can control all my players, not just Rhythmbox.

        – Adrian
        Dec 24 '18 at 15:51











      • I also restarted after making these changes (logging in and out is likely enough) to make them work

        – Salami
        Jan 4 at 2:30
















      8














      I recently faced the same issue and after losing a LOT of time I found an answer on some Arch forum.



      This whole issue looks like 'it's not a bug, it's a FEATURE' present from Gnome devs.



      In short: when you press a media button it generates a keycode which is then translated into a command. Let's say you press a Play/Pause button. It generates a keycode 162 and a command XF86AudioPlay.



      Now almost every media application that may be waiting for this event (be it VLC, totem, kodi, spotify etc.) expect to receive pure XF86AudioPlay command. And what Gnome does? It intercepts this command and translate it into it's own command "play". Because of this neither xev nor xbindkeys show this event properly - they never receive a command they can understand.



      When you press a media button Gnome receives the command and checks if there is any app that its recognized as capable of receiving this command. If there is (let's say totem, rhytmbox, maybe VLC) it sends "play" that should work. If there is no app recognised as capable of receiving this command Gnome will show the sign that is attached to first post and won't send any command anywhere.



      The solution is simple - make Gnome unable to intercept media key events. Install dconf-editor , go to org.gnome.settings-daemon.plugins.media-keys and change any button that should work from XF86SomeExapmle to none (''). This way any app should receive key command directly.






      share|improve this answer



















      • 1





        This works great. If you disable Play/Pause in Gnome Settings-Keyboard-Media Keys, Kodi can use it. But for fast forward and fast backward, still the "not-works" symbol from above appears but I do not know what to disable. Fast FF/BW ist not mentioned in the media keys.

        – jms
        Apr 22 '18 at 21:04











      • This was the secret sauce I needed. This, plus a combination of playerctl and xbindkeys and now my keyboard can control all my players, not just Rhythmbox.

        – Adrian
        Dec 24 '18 at 15:51











      • I also restarted after making these changes (logging in and out is likely enough) to make them work

        – Salami
        Jan 4 at 2:30














      8












      8








      8







      I recently faced the same issue and after losing a LOT of time I found an answer on some Arch forum.



      This whole issue looks like 'it's not a bug, it's a FEATURE' present from Gnome devs.



      In short: when you press a media button it generates a keycode which is then translated into a command. Let's say you press a Play/Pause button. It generates a keycode 162 and a command XF86AudioPlay.



      Now almost every media application that may be waiting for this event (be it VLC, totem, kodi, spotify etc.) expect to receive pure XF86AudioPlay command. And what Gnome does? It intercepts this command and translate it into it's own command "play". Because of this neither xev nor xbindkeys show this event properly - they never receive a command they can understand.



      When you press a media button Gnome receives the command and checks if there is any app that its recognized as capable of receiving this command. If there is (let's say totem, rhytmbox, maybe VLC) it sends "play" that should work. If there is no app recognised as capable of receiving this command Gnome will show the sign that is attached to first post and won't send any command anywhere.



      The solution is simple - make Gnome unable to intercept media key events. Install dconf-editor , go to org.gnome.settings-daemon.plugins.media-keys and change any button that should work from XF86SomeExapmle to none (''). This way any app should receive key command directly.






      share|improve this answer













      I recently faced the same issue and after losing a LOT of time I found an answer on some Arch forum.



      This whole issue looks like 'it's not a bug, it's a FEATURE' present from Gnome devs.



      In short: when you press a media button it generates a keycode which is then translated into a command. Let's say you press a Play/Pause button. It generates a keycode 162 and a command XF86AudioPlay.



      Now almost every media application that may be waiting for this event (be it VLC, totem, kodi, spotify etc.) expect to receive pure XF86AudioPlay command. And what Gnome does? It intercepts this command and translate it into it's own command "play". Because of this neither xev nor xbindkeys show this event properly - they never receive a command they can understand.



      When you press a media button Gnome receives the command and checks if there is any app that its recognized as capable of receiving this command. If there is (let's say totem, rhytmbox, maybe VLC) it sends "play" that should work. If there is no app recognised as capable of receiving this command Gnome will show the sign that is attached to first post and won't send any command anywhere.



      The solution is simple - make Gnome unable to intercept media key events. Install dconf-editor , go to org.gnome.settings-daemon.plugins.media-keys and change any button that should work from XF86SomeExapmle to none (''). This way any app should receive key command directly.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Mar 1 '18 at 19:32









      darkdudedarkdude

      8112




      8112








      • 1





        This works great. If you disable Play/Pause in Gnome Settings-Keyboard-Media Keys, Kodi can use it. But for fast forward and fast backward, still the "not-works" symbol from above appears but I do not know what to disable. Fast FF/BW ist not mentioned in the media keys.

        – jms
        Apr 22 '18 at 21:04











      • This was the secret sauce I needed. This, plus a combination of playerctl and xbindkeys and now my keyboard can control all my players, not just Rhythmbox.

        – Adrian
        Dec 24 '18 at 15:51











      • I also restarted after making these changes (logging in and out is likely enough) to make them work

        – Salami
        Jan 4 at 2:30














      • 1





        This works great. If you disable Play/Pause in Gnome Settings-Keyboard-Media Keys, Kodi can use it. But for fast forward and fast backward, still the "not-works" symbol from above appears but I do not know what to disable. Fast FF/BW ist not mentioned in the media keys.

        – jms
        Apr 22 '18 at 21:04











      • This was the secret sauce I needed. This, plus a combination of playerctl and xbindkeys and now my keyboard can control all my players, not just Rhythmbox.

        – Adrian
        Dec 24 '18 at 15:51











      • I also restarted after making these changes (logging in and out is likely enough) to make them work

        – Salami
        Jan 4 at 2:30








      1




      1





      This works great. If you disable Play/Pause in Gnome Settings-Keyboard-Media Keys, Kodi can use it. But for fast forward and fast backward, still the "not-works" symbol from above appears but I do not know what to disable. Fast FF/BW ist not mentioned in the media keys.

      – jms
      Apr 22 '18 at 21:04





      This works great. If you disable Play/Pause in Gnome Settings-Keyboard-Media Keys, Kodi can use it. But for fast forward and fast backward, still the "not-works" symbol from above appears but I do not know what to disable. Fast FF/BW ist not mentioned in the media keys.

      – jms
      Apr 22 '18 at 21:04













      This was the secret sauce I needed. This, plus a combination of playerctl and xbindkeys and now my keyboard can control all my players, not just Rhythmbox.

      – Adrian
      Dec 24 '18 at 15:51





      This was the secret sauce I needed. This, plus a combination of playerctl and xbindkeys and now my keyboard can control all my players, not just Rhythmbox.

      – Adrian
      Dec 24 '18 at 15:51













      I also restarted after making these changes (logging in and out is likely enough) to make them work

      – Salami
      Jan 4 at 2:30





      I also restarted after making these changes (logging in and out is likely enough) to make them work

      – Salami
      Jan 4 at 2:30













      5














      If the keyboard media keys do not work from your Ubuntu desktop, you can use D-Bus support to send the proper commands to Spotify. Validate the following commands from the console:



      Play/Pause



      dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause



      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



      Enable Media Key Shortcut



      To tie these to the keyboard, go to Settings > Keyboard > Shortcuts > Custom Shortcuts, then “Add”. Use one of the command above, then hit the key that you want to tie to the new command.



      Source



      https://fabianlee.org/2016/05/25/ubuntu-enabling-media-keys-for-spotify/






      share|improve this answer
























      • Excellent, this is exactly what I was looking for. Many thanks!

        – Josh Crozier
        Nov 3 '18 at 16:23











      • This worked for me in Ubuntu 14.04, except I use Compiz so I had to use the CompizConfig Settings Manager "Commands" applet to assign the shortcuts.

        – Tyler Collier
        Dec 15 '18 at 22:49
















      5














      If the keyboard media keys do not work from your Ubuntu desktop, you can use D-Bus support to send the proper commands to Spotify. Validate the following commands from the console:



      Play/Pause



      dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause



      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



      Enable Media Key Shortcut



      To tie these to the keyboard, go to Settings > Keyboard > Shortcuts > Custom Shortcuts, then “Add”. Use one of the command above, then hit the key that you want to tie to the new command.



      Source



      https://fabianlee.org/2016/05/25/ubuntu-enabling-media-keys-for-spotify/






      share|improve this answer
























      • Excellent, this is exactly what I was looking for. Many thanks!

        – Josh Crozier
        Nov 3 '18 at 16:23











      • This worked for me in Ubuntu 14.04, except I use Compiz so I had to use the CompizConfig Settings Manager "Commands" applet to assign the shortcuts.

        – Tyler Collier
        Dec 15 '18 at 22:49














      5












      5








      5







      If the keyboard media keys do not work from your Ubuntu desktop, you can use D-Bus support to send the proper commands to Spotify. Validate the following commands from the console:



      Play/Pause



      dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause



      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



      Enable Media Key Shortcut



      To tie these to the keyboard, go to Settings > Keyboard > Shortcuts > Custom Shortcuts, then “Add”. Use one of the command above, then hit the key that you want to tie to the new command.



      Source



      https://fabianlee.org/2016/05/25/ubuntu-enabling-media-keys-for-spotify/






      share|improve this answer













      If the keyboard media keys do not work from your Ubuntu desktop, you can use D-Bus support to send the proper commands to Spotify. Validate the following commands from the console:



      Play/Pause



      dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause



      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



      Enable Media Key Shortcut



      To tie these to the keyboard, go to Settings > Keyboard > Shortcuts > Custom Shortcuts, then “Add”. Use one of the command above, then hit the key that you want to tie to the new command.



      Source



      https://fabianlee.org/2016/05/25/ubuntu-enabling-media-keys-for-spotify/







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Aug 25 '18 at 0:05









      foamboarderfoamboarder

      15112




      15112













      • Excellent, this is exactly what I was looking for. Many thanks!

        – Josh Crozier
        Nov 3 '18 at 16:23











      • This worked for me in Ubuntu 14.04, except I use Compiz so I had to use the CompizConfig Settings Manager "Commands" applet to assign the shortcuts.

        – Tyler Collier
        Dec 15 '18 at 22:49



















      • Excellent, this is exactly what I was looking for. Many thanks!

        – Josh Crozier
        Nov 3 '18 at 16:23











      • This worked for me in Ubuntu 14.04, except I use Compiz so I had to use the CompizConfig Settings Manager "Commands" applet to assign the shortcuts.

        – Tyler Collier
        Dec 15 '18 at 22:49

















      Excellent, this is exactly what I was looking for. Many thanks!

      – Josh Crozier
      Nov 3 '18 at 16:23





      Excellent, this is exactly what I was looking for. Many thanks!

      – Josh Crozier
      Nov 3 '18 at 16:23













      This worked for me in Ubuntu 14.04, except I use Compiz so I had to use the CompizConfig Settings Manager "Commands" applet to assign the shortcuts.

      – Tyler Collier
      Dec 15 '18 at 22:49





      This worked for me in Ubuntu 14.04, except I use Compiz so I had to use the CompizConfig Settings Manager "Commands" applet to assign the shortcuts.

      – Tyler Collier
      Dec 15 '18 at 22:49











      2














      combination of last two answers works for me. I have Ubuntu 18.04 the keyboard test work



      ~$ sudo showkey -k
      press any key (program terminates 10s after last keypress)...
      keycode 163 press
      keycode 163 release
      keycode 165 press
      keycode 165 release
      keycode 164 press
      keycode 164 release


      but when I go to Activities -> Keyboard and try to do anything with Play / Next / Previous it not work at all. When I deactivated default key association (invoke dialog for key association, press backspace and click save) and create brand new one it works, very helpful was answer from @foamboarder



      now it looks like this screenshot from shortcut setup all works fine now even after wake up the computer from sleep mode






      share|improve this answer
























      • +1 because this eventually worked for me, but you should have included the commands you used in the custom keyboard shortcuts: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause and ...Previous and ...Next

        – bitinerant
        Feb 28 at 8:38
















      2














      combination of last two answers works for me. I have Ubuntu 18.04 the keyboard test work



      ~$ sudo showkey -k
      press any key (program terminates 10s after last keypress)...
      keycode 163 press
      keycode 163 release
      keycode 165 press
      keycode 165 release
      keycode 164 press
      keycode 164 release


      but when I go to Activities -> Keyboard and try to do anything with Play / Next / Previous it not work at all. When I deactivated default key association (invoke dialog for key association, press backspace and click save) and create brand new one it works, very helpful was answer from @foamboarder



      now it looks like this screenshot from shortcut setup all works fine now even after wake up the computer from sleep mode






      share|improve this answer
























      • +1 because this eventually worked for me, but you should have included the commands you used in the custom keyboard shortcuts: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause and ...Previous and ...Next

        – bitinerant
        Feb 28 at 8:38














      2












      2








      2







      combination of last two answers works for me. I have Ubuntu 18.04 the keyboard test work



      ~$ sudo showkey -k
      press any key (program terminates 10s after last keypress)...
      keycode 163 press
      keycode 163 release
      keycode 165 press
      keycode 165 release
      keycode 164 press
      keycode 164 release


      but when I go to Activities -> Keyboard and try to do anything with Play / Next / Previous it not work at all. When I deactivated default key association (invoke dialog for key association, press backspace and click save) and create brand new one it works, very helpful was answer from @foamboarder



      now it looks like this screenshot from shortcut setup all works fine now even after wake up the computer from sleep mode






      share|improve this answer













      combination of last two answers works for me. I have Ubuntu 18.04 the keyboard test work



      ~$ sudo showkey -k
      press any key (program terminates 10s after last keypress)...
      keycode 163 press
      keycode 163 release
      keycode 165 press
      keycode 165 release
      keycode 164 press
      keycode 164 release


      but when I go to Activities -> Keyboard and try to do anything with Play / Next / Previous it not work at all. When I deactivated default key association (invoke dialog for key association, press backspace and click save) and create brand new one it works, very helpful was answer from @foamboarder



      now it looks like this screenshot from shortcut setup all works fine now even after wake up the computer from sleep mode







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Sep 19 '18 at 7:54









      Václav RakVáclav Rak

      211




      211













      • +1 because this eventually worked for me, but you should have included the commands you used in the custom keyboard shortcuts: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause and ...Previous and ...Next

        – bitinerant
        Feb 28 at 8:38



















      • +1 because this eventually worked for me, but you should have included the commands you used in the custom keyboard shortcuts: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause and ...Previous and ...Next

        – bitinerant
        Feb 28 at 8:38

















      +1 because this eventually worked for me, but you should have included the commands you used in the custom keyboard shortcuts: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause and ...Previous and ...Next

      – bitinerant
      Feb 28 at 8:38





      +1 because this eventually worked for me, but you should have included the commands you used in the custom keyboard shortcuts: dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause and ...Previous and ...Next

      – bitinerant
      Feb 28 at 8:38











      0














      Using the above answer by @Václav worked for me on Ubuntu 18.04, where he said




      "... deactivated default key association (invoke dialog for key association, press backspace and click save) and create brand new one".




      I use Rhythmbox, here are the commands I was putting for each Custom Shorcut for Rhythmbox:



      For Previous:



      `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous`  


      For Next:



      `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next`  


      For Play/Stop:



      `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause`  


      Hope this helps someone one day






      share|improve this answer
























      • I installed playerctl and it can find and control most of the media players I use automatically.

        – Adrian
        Dec 24 '18 at 15:53
















      0














      Using the above answer by @Václav worked for me on Ubuntu 18.04, where he said




      "... deactivated default key association (invoke dialog for key association, press backspace and click save) and create brand new one".




      I use Rhythmbox, here are the commands I was putting for each Custom Shorcut for Rhythmbox:



      For Previous:



      `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous`  


      For Next:



      `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next`  


      For Play/Stop:



      `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause`  


      Hope this helps someone one day






      share|improve this answer
























      • I installed playerctl and it can find and control most of the media players I use automatically.

        – Adrian
        Dec 24 '18 at 15:53














      0












      0








      0







      Using the above answer by @Václav worked for me on Ubuntu 18.04, where he said




      "... deactivated default key association (invoke dialog for key association, press backspace and click save) and create brand new one".




      I use Rhythmbox, here are the commands I was putting for each Custom Shorcut for Rhythmbox:



      For Previous:



      `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous`  


      For Next:



      `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next`  


      For Play/Stop:



      `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause`  


      Hope this helps someone one day






      share|improve this answer













      Using the above answer by @Václav worked for me on Ubuntu 18.04, where he said




      "... deactivated default key association (invoke dialog for key association, press backspace and click save) and create brand new one".




      I use Rhythmbox, here are the commands I was putting for each Custom Shorcut for Rhythmbox:



      For Previous:



      `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous`  


      For Next:



      `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next`  


      For Play/Stop:



      `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause`  


      Hope this helps someone one day







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Nov 25 '18 at 16:10









      MilaziMilazi

      1012




      1012













      • I installed playerctl and it can find and control most of the media players I use automatically.

        – Adrian
        Dec 24 '18 at 15:53



















      • I installed playerctl and it can find and control most of the media players I use automatically.

        – Adrian
        Dec 24 '18 at 15:53

















      I installed playerctl and it can find and control most of the media players I use automatically.

      – Adrian
      Dec 24 '18 at 15:53





      I installed playerctl and it can find and control most of the media players I use automatically.

      – Adrian
      Dec 24 '18 at 15:53











      0














      I found that, with Ubuntu 18.04 LTS as of 2019/2/1, all I needed to do was:




      • install dconf-editor

      • navigate to org/gnome/settings-daemon/plugins/media-keys

      • for each key not working:


        • uncheck "Use default value"

        • hit apply

        • re-check "Use default value"

        • hit apply again




      Media keys in question should now work immediately.



      Using no value, as per darkdude recommended, didn't work for me.






      share|improve this answer




























        0














        I found that, with Ubuntu 18.04 LTS as of 2019/2/1, all I needed to do was:




        • install dconf-editor

        • navigate to org/gnome/settings-daemon/plugins/media-keys

        • for each key not working:


          • uncheck "Use default value"

          • hit apply

          • re-check "Use default value"

          • hit apply again




        Media keys in question should now work immediately.



        Using no value, as per darkdude recommended, didn't work for me.






        share|improve this answer


























          0












          0








          0







          I found that, with Ubuntu 18.04 LTS as of 2019/2/1, all I needed to do was:




          • install dconf-editor

          • navigate to org/gnome/settings-daemon/plugins/media-keys

          • for each key not working:


            • uncheck "Use default value"

            • hit apply

            • re-check "Use default value"

            • hit apply again




          Media keys in question should now work immediately.



          Using no value, as per darkdude recommended, didn't work for me.






          share|improve this answer













          I found that, with Ubuntu 18.04 LTS as of 2019/2/1, all I needed to do was:




          • install dconf-editor

          • navigate to org/gnome/settings-daemon/plugins/media-keys

          • for each key not working:


            • uncheck "Use default value"

            • hit apply

            • re-check "Use default value"

            • hit apply again




          Media keys in question should now work immediately.



          Using no value, as per darkdude recommended, didn't work for me.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 1 at 14:52









          poetichustlapoetichustla

          1




          1























              -1














              The key-codes seem not to be mapped accordingly.
              You can manually map keys as described in the ubuntu documentation:
              https://help.ubuntu.com/stable/ubuntu-help/keyboard-shortcuts-set.html




              1. Open the Activities overview and start typing Keyboard.

              2. Click on Keyboard to open the panel.

              3. Select the Shortcuts tab.

              4. Select a category in the left pane, and the row for the desired action on the right. The current shortcut definition will change to New accelerator…

              5. Hold down the desired key combination, or press Backspace to clear.






              share|improve this answer




























                -1














                The key-codes seem not to be mapped accordingly.
                You can manually map keys as described in the ubuntu documentation:
                https://help.ubuntu.com/stable/ubuntu-help/keyboard-shortcuts-set.html




                1. Open the Activities overview and start typing Keyboard.

                2. Click on Keyboard to open the panel.

                3. Select the Shortcuts tab.

                4. Select a category in the left pane, and the row for the desired action on the right. The current shortcut definition will change to New accelerator…

                5. Hold down the desired key combination, or press Backspace to clear.






                share|improve this answer


























                  -1












                  -1








                  -1







                  The key-codes seem not to be mapped accordingly.
                  You can manually map keys as described in the ubuntu documentation:
                  https://help.ubuntu.com/stable/ubuntu-help/keyboard-shortcuts-set.html




                  1. Open the Activities overview and start typing Keyboard.

                  2. Click on Keyboard to open the panel.

                  3. Select the Shortcuts tab.

                  4. Select a category in the left pane, and the row for the desired action on the right. The current shortcut definition will change to New accelerator…

                  5. Hold down the desired key combination, or press Backspace to clear.






                  share|improve this answer













                  The key-codes seem not to be mapped accordingly.
                  You can manually map keys as described in the ubuntu documentation:
                  https://help.ubuntu.com/stable/ubuntu-help/keyboard-shortcuts-set.html




                  1. Open the Activities overview and start typing Keyboard.

                  2. Click on Keyboard to open the panel.

                  3. Select the Shortcuts tab.

                  4. Select a category in the left pane, and the row for the desired action on the right. The current shortcut definition will change to New accelerator…

                  5. Hold down the desired key combination, or press Backspace to clear.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 21 '18 at 14:05









                  Arne QArne Q

                  244




                  244






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f990284%2fmedia-keys-not-working-on-ubuntu-17-10%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Human spaceflight

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                      File:DeusFollowingSea.jpg