Add xkcd module
Added a module that opens a random xkcd comic when clicked.
This commit is contained in:
parent
a8580bb42d
commit
ba934dc675
1 changed files with 17 additions and 0 deletions
17
bumblebee/modules/xkcd.py
Normal file
17
bumblebee/modules/xkcd.py
Normal 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/"
|
||||
)
|
Loading…
Reference in a new issue