From 8682fa232ad605d26c91c6e8101c29af350c09b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= Date: Tue, 21 Nov 2017 01:09:50 +0100 Subject: [PATCH] temp: Honor color setting when pango is enabled and dynamic color is False (#625) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- i3pystatus/temp.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/i3pystatus/temp.py b/i3pystatus/temp.py index 16a2d34..e14c64e 100644 --- a/i3pystatus/temp.py +++ b/i3pystatus/temp.py @@ -209,7 +209,8 @@ class Temperature(IntervalModule, ColorRangeModule): data['temp'] = max((s.current for s in found_sensors)) return { 'full_text': self.format.format(**data), - 'urgent': self.get_urgent(found_sensors) + 'urgent': self.get_urgent(found_sensors), + 'color': self.color if not self.dynamic_color else None, } def get_urgent(self, sensors): @@ -230,9 +231,7 @@ class Temperature(IntervalModule, ColorRangeModule): percentage = self.percentage(sensor.current, sensor.critical) if self.dynamic_color: color = self.colors[int(percentage)] - else: - color = self.color - return self.format_pango(color, current_val) + return self.format_pango(color, current_val) return current_val def format_sensor_bar(self, sensor): @@ -242,9 +241,7 @@ class Temperature(IntervalModule, ColorRangeModule): if self.pango_enabled: if self.dynamic_color: color = self.colors[int(percentage)] - else: - color = self.color - return self.format_pango(color, bar) + return self.format_pango(color, bar) return bar def format_pango(self, color, value):