I am on Ubuntu 16.04, I cannot play, pause, go to the next or the previous song in spotify. There are many answers but most are complicated, is there a simple solution that doesn't require a command line?
I have a Logitech bluetooth keyboard.
I am on Ubuntu 16.04, I cannot play, pause, go to the next or the previous song in spotify. There are many answers but most are complicated, is there a simple solution that doesn't require a command line?
I have a Logitech bluetooth keyboard.
Here is another link i have found that help me and its the same solutions as k2shah mention it, but with more details.
Instead of downloading the spotify_control, you use the D-Bus commands. Before you add it as a new keyboard command, feel free to execute those commands.
Play/Stop
Next
Previous
Once you validate the above commands, feel free to add them as Key Shortcut. For Ubuntu, "Settings > Devices > Keyboard" than add (+) and put the name and copy the commands, than put the keyboard shortcut.
TheLink
There is a simple solution credit goes to this thread on Spotify forum, Thanks to schuellerf and rszabla. The solution is pretty simple and works on any Linux distribution.
chmod a+x spotify_control
The command you see in the picture above is for 'play/pause' function
/home/your_username/Downloads/spotify_control playpause
The commands that are available
/home/your_username/Downloads/spotify_control playpause
/home/your_username/Downloads/spotify_control previous
/home/your_username/Downloads/spotify_control next
/home/your_username/Downloads/spotify_control play
/home/your_username/Downloads/spotify_control stop
Please note that you have to do this
/home/your_username/Downloads/spotify_control playpause
Because
~/Downloads/spotify_control playpause
That won't work, at least not in Ubuntu 16.04, unity desktop, the shortcut manager doesn't seem to understand the tilde
~
The top-voted solutions are about adding a custom key mapping, which is kinda cumbersome, as you have to drop every other binding related to the Play/Pause key.
There's only one binding possible for a key so it means that your Play/Pause key stops working anywhere outside Spotify.
Initially, I wanted to do that, but Ubuntu settings didn't let me create a binding so the key was used/captured by something else on my system. It turned out that Chrome captures hardware media keys by default :)
You can disable this functionality by opening
chrome://flags/
and then disabling
Hardware Media Key Handling
feature.After doing so, your Play/Stop key along with Next and Previous keys are handled by Ubuntu itself again.
It fixed the issue for me. Now Spotify is the one to capture these keys.
This also happens on Firefox, you can access the option in:
about:config
Then, change
media.hardwaremediakeys.enabled
tofalse
All i had to do in Fedora is
sudo dnf install playerctl
Anyway, it works in Ubuntu, no idea why such a basic functionality is missing here.
Considering the Aiphee Answer on ubuntu or Debian this works!
Package info: utility to control media players via MPRIS https://packages.debian.org/buster/playerctl
If you don't want to download a file and keep it around (for whatever reason) you can just assign the key to the command that's run in the file
I set up a new custom keybind
Name: Spotify Play/Pause
Command:
for the other commands just replace the
PlayPause
withStop
,Next
, orPrevious
You can call the D-Bus command directly.
System settings
Shortcuts -> Custom Shortcuts
Edit -> New -> Global Shortcuts -> D-Bus Command
( the button is at bottom )Spotify-Next
org.mpris.MediaPlayer2.spotify
/org/mpris/MediaPlayer2
org.mpris.MediaPlayer2.Player.Next
For Previous use
org.mpris.MediaPlayer2.Player.Previous
For Play/Pause uset
org.mpris.MediaPlayer2.Player.PlayPause
You can test it with Call button More is
Thanks to IvanAK .