Merge pull request #147 from rccavalcanti/spotify-ctrl

Add click events to Spotify module
This commit is contained in:
tobi-wan-kenobi 2017-07-24 17:00:48 +02:00 committed by GitHub
commit 443a1098ca

View file

@ -25,6 +25,15 @@ class Module(bumblebee.engine.Module):
)
self._song = ""
cmd="dbus-send --session --type=method_call --dest=org.mpris.MediaPlayer2.spotify \
/org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player."
engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE,
cmd=cmd + "Previous")
engine.input.register_callback(self, button=bumblebee.input.RIGHT_MOUSE,
cmd=cmd + "Next")
engine.input.register_callback(self, button=bumblebee.input.MIDDLE_MOUSE,
cmd=cmd + "PlayPause")
def spotify(self, widget):
return str(self._song)