From 802b342a1c967b003bd3980dec2d6c775ecf8166 Mon Sep 17 00:00:00 2001 From: June Tate-Gans Date: Sun, 23 May 2021 11:31:12 -0500 Subject: [PATCH] clock: Display CPU percentage correctly psutil.cpu_percent() actually delivers a percentage from 0 to 100. We need to normalize that value to 0..1 to display properly. --- g13gui/applets/clock.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/g13gui/applets/clock.py b/g13gui/applets/clock.py index ba812c7..34b47f9 100644 --- a/g13gui/applets/clock.py +++ b/g13gui/applets/clock.py @@ -48,8 +48,8 @@ class ClockApplet(Applet): DISPLAY_WIDTH // 2 - 5, 12) self.screen.addChild(self._loadGraph) - self._ramGraph = Graph(DISPLAY_WIDTH // 2 + 5, 18, - DISPLAY_WIDTH // 2 - 7, 12) + self._ramGraph = Graph(DISPLAY_WIDTH // 2 + 2, 18, + DISPLAY_WIDTH // 2 - 5, 12) self.screen.addChild(self._ramGraph) self._update() @@ -73,7 +73,7 @@ class ClockApplet(Applet): x = (DISPLAY_WIDTH // 2) - (w // 2) self._timeLabel.position = (x, 0) - self._loadGraph.addValue(psutil.cpu_percent()) + self._loadGraph.addValue(psutil.cpu_percent() / 100) self._ramGraph.addValue(psutil.virtual_memory().percent / 100) def _pushTime(self):