From d189b3a335ea518716f087000ca1af2e2e45df7f Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Thu, 15 Jun 2017 13:21:59 +0200 Subject: [PATCH] [modules/battery] Remove leading zeroes and use minwidth --- bumblebee/modules/battery.py | 8 ++++---- bumblebee/modules/cpu.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bumblebee/modules/battery.py b/bumblebee/modules/battery.py index 5384716..3d47efa 100644 --- a/bumblebee/modules/battery.py +++ b/bumblebee/modules/battery.py @@ -16,9 +16,9 @@ import bumblebee.engine class Module(bumblebee.engine.Module): def __init__(self, engine, config): - super(Module, self).__init__(engine, config, - bumblebee.output.Widget(full_text=self.capacity) - ) + widget = bumblebee.output.Widget(full_text=self.capacity) + widget.set("theme.minwidth", "100%") + super(Module, self).__init__(engine, config, widget) battery = self.parameter("device", "BAT0") self._path = "/sys/class/power_supply/{}".format(battery) self._capacity = 100 @@ -29,7 +29,7 @@ class Module(bumblebee.engine.Module): return "ac" if self._capacity == -1: return "n/a" - return "{:03d}%".format(self._capacity) + return "{}%".format(self._capacity) def update(self, widgets): self._ac = False diff --git a/bumblebee/modules/cpu.py b/bumblebee/modules/cpu.py index 69f2a46..5f13401 100644 --- a/bumblebee/modules/cpu.py +++ b/bumblebee/modules/cpu.py @@ -26,7 +26,7 @@ class Module(bumblebee.engine.Module): cmd="gnome-system-monitor") def utilization(self, _): - return "{:6.01f}%".format(self._utilization) + return "{:.01f}%".format(self._utilization) def update(self, widgets): self._utilization = psutil.cpu_percent(percpu=False)