Use media keys to play/pause to either control spotify, vlc or firefox

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite
1












Before I switched to bspwm, I used KDE/Plasma 5. In KDE, I could use my media keys to play/pause, etc in vlc, spotify and even in Firefox with an addon (youtube, netflix, pretty much everything worked). When both VLC, Firefox and Spotify were open, the media keys controlled the last used player, regardless if the window is open or not.



I'd like to get the same functionality in bspwm.



Right now I'm using playerctl -p spotify play-pause to control spotify, which is bound to XF86AudioPlay in sxhkdrc. I'd also like to do this with VLC, but playerctl needs to know which player to play/pause, if both are open.



Is there a way to get the same KDE/Plasma functionality for both VLC, Firefox and Spotify? If not, is there a way to determine which player was last active? That way I could write a script to play/pause only the last active player.









share

























    up vote
    0
    down vote

    favorite
    1












    Before I switched to bspwm, I used KDE/Plasma 5. In KDE, I could use my media keys to play/pause, etc in vlc, spotify and even in Firefox with an addon (youtube, netflix, pretty much everything worked). When both VLC, Firefox and Spotify were open, the media keys controlled the last used player, regardless if the window is open or not.



    I'd like to get the same functionality in bspwm.



    Right now I'm using playerctl -p spotify play-pause to control spotify, which is bound to XF86AudioPlay in sxhkdrc. I'd also like to do this with VLC, but playerctl needs to know which player to play/pause, if both are open.



    Is there a way to get the same KDE/Plasma functionality for both VLC, Firefox and Spotify? If not, is there a way to determine which player was last active? That way I could write a script to play/pause only the last active player.









    share























      up vote
      0
      down vote

      favorite
      1









      up vote
      0
      down vote

      favorite
      1






      1





      Before I switched to bspwm, I used KDE/Plasma 5. In KDE, I could use my media keys to play/pause, etc in vlc, spotify and even in Firefox with an addon (youtube, netflix, pretty much everything worked). When both VLC, Firefox and Spotify were open, the media keys controlled the last used player, regardless if the window is open or not.



      I'd like to get the same functionality in bspwm.



      Right now I'm using playerctl -p spotify play-pause to control spotify, which is bound to XF86AudioPlay in sxhkdrc. I'd also like to do this with VLC, but playerctl needs to know which player to play/pause, if both are open.



      Is there a way to get the same KDE/Plasma functionality for both VLC, Firefox and Spotify? If not, is there a way to determine which player was last active? That way I could write a script to play/pause only the last active player.









      share













      Before I switched to bspwm, I used KDE/Plasma 5. In KDE, I could use my media keys to play/pause, etc in vlc, spotify and even in Firefox with an addon (youtube, netflix, pretty much everything worked). When both VLC, Firefox and Spotify were open, the media keys controlled the last used player, regardless if the window is open or not.



      I'd like to get the same functionality in bspwm.



      Right now I'm using playerctl -p spotify play-pause to control spotify, which is bound to XF86AudioPlay in sxhkdrc. I'd also like to do this with VLC, but playerctl needs to know which player to play/pause, if both are open.



      Is there a way to get the same KDE/Plasma functionality for both VLC, Firefox and Spotify? If not, is there a way to determine which player was last active? That way I could write a script to play/pause only the last active player.







      d-bus vlc mediaplayer





      share












      share










      share



      share










      asked 4 mins ago









      zjeffer

      285




      285

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477823%2fuse-media-keys-to-play-pause-to-either-control-spotify-vlc-or-firefox%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477823%2fuse-media-keys-to-play-pause-to-either-control-spotify-vlc-or-firefox%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay