From eb0035fdd04c2b72063c88e3a8ee83e1de047368 Mon Sep 17 00:00:00 2001 From: Rafael Cavalcanti Date: Mon, 24 Jul 2017 11:19:39 -0300 Subject: [PATCH] Add click events to Spotify module --- bumblebee/modules/spotify.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bumblebee/modules/spotify.py b/bumblebee/modules/spotify.py index da7d032..22ddc6a 100644 --- a/bumblebee/modules/spotify.py +++ b/bumblebee/modules/spotify.py @@ -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)