Skip to content

Commit

Permalink
temp: Honor color setting when pango is enabled and dynamic color is …
Browse files Browse the repository at this point in the history
…False (enkore#625)

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
  • Loading branch information
kyrias authored and facetoe committed Nov 21, 2017
1 parent 9818e8d commit 8682fa2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions i3pystatus/temp.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ def get_output_sensors(self):
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):
Expand All @@ -230,9 +231,7 @@ def format_sensor(self, sensor):
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):
Expand All @@ -242,9 +241,7 @@ def format_sensor_bar(self, sensor):
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):
Expand Down

0 comments on commit 8682fa2

Please sign in to comment.