From 30ea9e2e6961a8755b824e0e5b3f781d776a6c94 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Sat, 8 Jul 2017 08:22:52 +0200 Subject: [PATCH 1/2] [module/github] Refresh on right click --- bumblebee/modules/github.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/github.py b/bumblebee/modules/github.py index 1211fd7..dc38b5e 100644 --- a/bumblebee/modules/github.py +++ b/bumblebee/modules/github.py @@ -11,6 +11,7 @@ Parameters: """ import time +import functools import bumblebee.input import bumblebee.output import bumblebee.engine @@ -30,12 +31,15 @@ class Module(bumblebee.engine.Module): self._nextcheck = 0 engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE, cmd="x-www-browser https://github.com/notifications") + immediate_update = functools.partial(self.update, immediate=True) + engine.input.register_callback(self, button=bumblebee.input.RIGHT_MOUSE, + cmd=immediate_update) def github(self, _): return str(self._count) - def update(self, widgets): - if self._nextcheck < int(time.time()): + def update(self, _, immediate=False): + if immediate or self._nextcheck < int(time.time()): self._nextcheck = int(time.time()) + self._interval * 60 token = self.parameter("token", "") From dc5e657bc364e665359a0ade849b79ca3c7135f9 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Sat, 8 Jul 2017 08:27:59 +0200 Subject: [PATCH 2/2] [module/github] Doc for github.token OAuth scope --- bumblebee/modules/github.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bumblebee/modules/github.py b/bumblebee/modules/github.py index dc38b5e..6c97650 100644 --- a/bumblebee/modules/github.py +++ b/bumblebee/modules/github.py @@ -6,7 +6,7 @@ Requires the following library: * requests Parameters: - * github.token: GitHub user access token + * github.token: GitHub user access token, the token needs to have the 'notifications' scope. * github.interval: Interval in minutes """