I'm using unity desktop on Ubuntu 19.04
But the media shortcut not work I search and do this solution:
media keys no longer work in Ubuntu 17.10
Keyboard shortcuts don't work on Ubuntu 18.04 with Unity
Now I try to do it with command lines:
Play:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play
Pause:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
Play/Pause toggle:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
Previous:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
Next:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
but I have this error :
Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.mpris.MediaPlayer2.spotify was not provided by any .service files
wtf,I search in repo: https://packages.ubuntu.com/search?suite=disco&arch=any&mode=filename&searchon=contents&keywords=org.mpris.MediaPlayer2
and do this:
sudo apt-get install mopidy-mpris mpdris2 -y
Now why the commands not work? Is the medias key not work related to this command?
How can I fix this issue?