Merge pull request #293 from whzup/xkcd

Add xkcd module
This commit is contained in:
tobi-wan-kenobi 2018-09-11 18:56:38 +02:00 committed by GitHub
commit 353202840c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

17
bumblebee/modules/xkcd.py Normal file
View file

@ -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/"
)