From 3bb2fb82479aa28d3037f4229def52e9db5df6eb Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Fri, 15 May 2020 19:59:13 +0200 Subject: [PATCH] [core/module] add missing registration of input events via CLI see #628 --- bumblebee-status | 1 + bumblebee_status/core/module.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/bumblebee-status b/bumblebee-status index dcaa8bd..9e4ea82 100755 --- a/bumblebee-status +++ b/bumblebee-status @@ -102,6 +102,7 @@ def main(): for module in config.modules(): modules.append(core.module.load(module, config, theme)) + modules[-1].register_callbacks() if config.reverse(): modules.reverse() diff --git a/bumblebee_status/core/module.py b/bumblebee_status/core/module.py index d8faa1c..e01d652 100644 --- a/bumblebee_status/core/module.py +++ b/bumblebee_status/core/module.py @@ -201,6 +201,18 @@ class Module(core.input.Object): return "warning" return None + def register_callbacks(self): + actions = [ + { "name": "left-click", "id": core.input.LEFT_MOUSE }, + { "name": "right-click", "id": core.input.RIGHT_MOUSE }, + { "name": "middle-click", "id": core.input.MIDDLE_MOUSE }, + { "name": "wheel-up", "id": core.input.WHEEL_UP }, + { "name": "wheel-down", "id": core.input.WHEEL_DOWN }, + ] + for action in actions: + if self.parameter(action["name"]): + core.input.register(self, action["id"], self.parameter(action["name"])) + class Error(Module): """Represents an "error" module