Add click events to Spotify module

This commit is contained in:
Rafael Cavalcanti 2017-07-24 11:19:39 -03:00
parent a312269240
commit eb0035fdd0

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)