From 277ea2f255f2d738b9bc9b08d9d91d73237b4c9a Mon Sep 17 00:00:00 2001 From: ibrokemypie Date: Fri, 2 Jun 2017 16:25:49 +1000 Subject: [PATCH] [module/cpu] More useful rounding psutil.cpu_percent() only outputs to one decimal place anyway, so the trailing 0 is useless. The prepended 0 is also not important, will only be not 0 at 100% utilization, so why not let it be 100% then and take up one less column otherwise? --- bumblebee/modules/cpu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bumblebee/modules/cpu.py b/bumblebee/modules/cpu.py index 6a24bdc..10a2559 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, widget): - return "{:06.02f}%".format(self._utilization) + return "{:6.01f}%".format(self._utilization) def update(self, widgets): self._utilization = psutil.cpu_percent(percpu=False)