diff --git a/bumblebee/theme.py b/bumblebee/theme.py index 50e0c19..02af8dc 100644 --- a/bumblebee/theme.py +++ b/bumblebee/theme.py @@ -186,9 +186,14 @@ class Theme(object): result[key] = colors[field][key] return result + def color(self, color_name, default=None): + return self._colorset.get(color_name, default) + def _load_colors(self, name): """Load colors for a theme""" try: + if isinstance(name, dict): + return name if name.lower() == "wal": return self._load_wal_colors() except Exception as err: @@ -285,7 +290,7 @@ class Theme(object): if isinstance(value, (dict, list)): return value - return self._colorset.get(value, value) + return self.color(value, value) # algorithm copied from # http://blog.impressiver.com/post/31434674390/deep-merge-multiple-python-dicts diff --git a/themes/gruvbox-powerline.json b/themes/gruvbox-powerline.json index 3481dbc..d009bd8 100644 --- a/themes/gruvbox-powerline.json +++ b/themes/gruvbox-powerline.json @@ -1,13 +1,19 @@ { "icons": [ "paxy97", "awesome-fonts" ], + "colors": [{ + "fg0": "#fbf1c7", + "bg0_h": "#1d2021", + "yellow": "#d79921", + "red": "#cc241d" + }], "defaults": { "warning": { - "fg": "#1d2021", - "bg": "#d79921" + "fg": "bg0_h", + "bg": "yellow" }, "critical": { - "fg": "#fbf1c7", - "bg": "#cc241d" + "fg": "fg0", + "bg": "red" }, "default-separators": false, "separator-block-width": 0