From d0418446e1325fd9bb0ae8222e4bbf2a407b6967 Mon Sep 17 00:00:00 2001 From: me Date: Thu, 20 Feb 2020 01:10:28 +0200 Subject: [PATCH 1/2] [theme/nord-powerline] add palette colors --- themes/nord-powerline.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/themes/nord-powerline.json b/themes/nord-powerline.json index 1567498..ee17ada 100644 --- a/themes/nord-powerline.json +++ b/themes/nord-powerline.json @@ -1,5 +1,11 @@ { "icons": [ "awesome-fonts" ], + "colors": [{ + "red": "#BF616A", + "orange": "#D08770", + "yellow": "#EBCB8B", + "green": "#A3BE8C" + }], "defaults": { "separator-block-width": 0, "warning": { From bf03ad7184599bd7b07df61a8c18dd00a6383dcb Mon Sep 17 00:00:00 2001 From: me Date: Thu, 20 Feb 2020 01:24:15 +0200 Subject: [PATCH 2/2] [modules/cpu2] use theme palette colors for core load bars As discussed in #556. - added palette red, orange, yellow, green to nord-powerline - when used with nord-powerline (or any other theme that has these palette colors) and cpu2.colored=1, the cpu2 module will use these custom colors to display core load graphs; when colors are missing from a theme - it will use default colors --- bumblebee/modules/cpu2.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bumblebee/modules/cpu2.py b/bumblebee/modules/cpu2.py index d7e83b5..1e78a2d 100644 --- a/bumblebee/modules/cpu2.py +++ b/bumblebee/modules/cpu2.py @@ -91,17 +91,16 @@ class Module(bumblebee.engine.Module): def cpuload(self, _): return "{}%".format(self._cpuload) - @staticmethod - def add_color(bar): + def add_color(self, bar): """add color as pango markup to a bar""" if bar in ["▁", "▂"]: - color = "green" + color = self.theme().color("green", "green") elif bar in ["▃", "▄"]: - color = "yellow" + color = self.theme().color("yellow", "yellow") elif bar in ["▅", "▆"]: - color = "orange" + color = self.theme().color("orange", "orange") elif bar in ["▇", "█"]: - color = "red" + color = self.theme().color("red", "red") colored_bar = "{}".format(color, bar) return colored_bar