bumblebee-status/core/event.py
Tobias Witek 38410adcb8 [core/theme|output] Add separators
Add a way for themes to specify custom separators. Doing that, make
nicer interfaces for drawing "supplementary" components (separators)
for widgets and generalize the attribute retrieval within the theme.
2020-02-22 13:42:44 +01:00

16 lines
334 B
Python

callbacks = {}
def register(event, callback, *args, **kwargs):
callbacks.setdefault(event, []).append(
lambda: callback(*args, **kwargs)
)
def clear():
callbacks.clear()
def trigger(event):
for callback in callbacks.get(event, []):
callback()
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4