[modules/cpu2] align cpu load

This fixes a rough edge in cpu2 module where variable size of total cpu
load value string was making the whole bar slide during updates. CPU
load is right-alligned now and takes 3 chars in the widget, so load can
go up to 100 and still fit.
This commit is contained in:
me 2020-02-28 17:30:52 +02:00
parent 46d376a382
commit 87725f783a

View file

@ -89,7 +89,7 @@ class Module(bumblebee.engine.Module):
return "{:.2f}GHz".format(self._maxfreq) return "{:.2f}GHz".format(self._maxfreq)
def cpuload(self, _): def cpuload(self, _):
return "{}%".format(self._cpuload) return "{:>3}%".format(self._cpuload)
def add_color(self, bar): def add_color(self, bar):
"""add color as pango markup to a bar""" """add color as pango markup to a bar"""