[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?
This commit is contained in:
ibrokemypie 2017-06-02 16:25:49 +10:00
parent c75ad75920
commit 277ea2f255

View file

@ -26,7 +26,7 @@ class Module(bumblebee.engine.Module):
cmd="gnome-system-monitor") cmd="gnome-system-monitor")
def utilization(self, widget): def utilization(self, widget):
return "{:06.02f}%".format(self._utilization) return "{:6.01f}%".format(self._utilization)
def update(self, widgets): def update(self, widgets):
self._utilization = psutil.cpu_percent(percpu=False) self._utilization = psutil.cpu_percent(percpu=False)