From ba934dc675940d6ed9c9d3cdd9e006c13b65b723 Mon Sep 17 00:00:00 2001 From: Aaron Moser <39431903+whzup@users.noreply.github.com> Date: Tue, 11 Sep 2018 16:49:57 +0200 Subject: [PATCH] Add xkcd module Added a module that opens a random xkcd comic when clicked. --- bumblebee/modules/xkcd.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 bumblebee/modules/xkcd.py diff --git a/bumblebee/modules/xkcd.py b/bumblebee/modules/xkcd.py new file mode 100644 index 0000000..143e590 --- /dev/null +++ b/bumblebee/modules/xkcd.py @@ -0,0 +1,17 @@ +#pylint: disable=C0111,R0903 + +"""Opens a random xkcd comic in the browser.""" + +import bumblebee.input +import bumblebee.output +import bumblebee.engine + + +class Module(bumblebee.engine.Module): + def __init__(self, engine, config): + super(Module, self).__init__(engine, config, + bumblebee.output.Widget(full_text="xkcd") + ) + engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE, + cmd="xdg-open https://c.xkcd.com/random/comic/" + )