From b1ec41f9050411cd073b582baa2382345d70566d Mon Sep 17 00:00:00 2001 From: Tobi-wan Kenobi Date: Sat, 10 Dec 2016 08:19:24 +0100 Subject: [PATCH] [modules/cmus] Add mouse controls Enable play/pause, repeat/shuffle toggle, next/prev song by clicking on the various elements in the bar. see #23 --- bumblebee/modules/cmus.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bumblebee/modules/cmus.py b/bumblebee/modules/cmus.py index b58d47f..cdd52a8 100644 --- a/bumblebee/modules/cmus.py +++ b/bumblebee/modules/cmus.py @@ -21,6 +21,18 @@ class Module(bumblebee.engine.Module): bumblebee.output.Widget(name="cmus.repeat"), ] super(Module, self).__init__(engine, config, widgets) + + engine.input.register_callback(widgets[0], button=bumblebee.input.LEFT_MOUSE, + cmd="cmus-remote -r") + engine.input.register_callback(widgets[1], button=bumblebee.input.LEFT_MOUSE, + cmd="cmus-remote -u") + engine.input.register_callback(widgets[2], button=bumblebee.input.LEFT_MOUSE, + cmd="cmus-remote -n") + engine.input.register_callback(widgets[3], button=bumblebee.input.LEFT_MOUSE, + cmd="cmus-remote -S") + engine.input.register_callback(widgets[4], button=bumblebee.input.LEFT_MOUSE, + cmd="cmus-remote -R") + self._fmt = self.parameter("format", "{artist} - {title} {position}/{duration}") self._status = None self._shuffle = False