[core/theme] Add per-module theme override

Allow users to override theme values via parameter, such as:

bumblebee-status -m spacer -p spacer.theme.bg=#ff0000

for a red spacer.

see #223
This commit is contained in:
Tobias Witek 2018-01-17 18:49:09 +01:00
parent 323c1df6cc
commit 9f77514a1c

View file

@ -233,6 +233,8 @@ class Theme(object):
widget.set(key, (idx + 1) % len(value)) widget.set(key, (idx + 1) % len(value))
value = value[idx] value = value[idx]
value = widget.get_module().parameter("theme.{}".format(name), value)
if isinstance(value, list) or isinstance(value, dict): if isinstance(value, list) or isinstance(value, dict):
return value return value
return self._colorset.get(value, value) return self._colorset.get(value, value)