From 7e45e797f11083f58765f0bc48ce512d7c10c663 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Thu, 15 Jun 2017 11:00:22 +0200 Subject: [PATCH] [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. --- bumblebee/modules/cpu.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/cpu.py b/bumblebee/modules/cpu.py index 1a9a97d..69f2a46 100644 --- a/bumblebee/modules/cpu.py +++ b/bumblebee/modules/cpu.py @@ -18,8 +18,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.utilization)) + widget = 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) engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE, cmd="gnome-system-monitor")