diff options
Diffstat (limited to 'src/tiptop/_battery.py')
-rw-r--r-- | src/tiptop/_battery.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tiptop/_battery.py b/src/tiptop/_battery.py index 68dbaf0..2d6ed96 100644 --- a/src/tiptop/_battery.py +++ b/src/tiptop/_battery.py @@ -14,7 +14,8 @@ class Battery(Widget): "", title="", title_align="left", - border_style="yellow", + # border_style="yellow", + border_style="white", box=box.SQUARE, ) self.collect_data() @@ -23,6 +24,7 @@ class Battery(Widget): def collect_data(self): bat = psutil.sensors_battery() + assert bat is not None self.bat_stream.add_value(bat.percent) @@ -40,7 +42,7 @@ class Battery(Widget): time_left_str.append(f"{mm}min") status = " ".join(time_left_str) + " left" - title = f"battery - {self.bat_stream.values[-1]:.1f}% - {status}" + title = f"[b]battery[/] - {self.bat_stream.values[-1]:.1f}% - {status}" if bat.percent < 15 and not bat.power_plugged: title = "[red reverse bold]" + title + "[/]" |