[modules/cpu] Enforce minimum width
Set the minimum width of the CPU widget to 99.9% to avoid constant size changes as the utilization fluctuates between one and two digit numbers.
This commit is contained in:
parent
e3f6642fcf
commit
7e45e797f1
1 changed files with 3 additions and 2 deletions
|
@ -18,8 +18,9 @@ import bumblebee.engine
|
||||||
|
|
||||||
class Module(bumblebee.engine.Module):
|
class Module(bumblebee.engine.Module):
|
||||||
def __init__(self, engine, config):
|
def __init__(self, engine, config):
|
||||||
super(Module, self).__init__(engine, config,
|
widget = bumblebee.output.Widget(full_text=self.utilization)
|
||||||
bumblebee.output.Widget(full_text=self.utilization))
|
widget.set("theme.minwidth", "99.9%")
|
||||||
|
super(Module, self).__init__(engine, config, widget)
|
||||||
self._utilization = psutil.cpu_percent(percpu=False)
|
self._utilization = psutil.cpu_percent(percpu=False)
|
||||||
engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE,
|
engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE,
|
||||||
cmd="gnome-system-monitor")
|
cmd="gnome-system-monitor")
|
||||||
|
|
Loading…
Reference in a new issue