From 0f9d10ef4e389d87246bc3d2a70a79fe4b29ad4a Mon Sep 17 00:00:00 2001 From: Daniel Carrillo Date: Fri, 30 Jun 2023 19:48:49 +0200 Subject: [PATCH] [polybar] Fix python issues with cpu_usage.py --- .config/polybar/scripts/cpu_usage.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/polybar/scripts/cpu_usage.py b/.config/polybar/scripts/cpu_usage.py index f925e4e..3e7f0eb 100755 --- a/.config/polybar/scripts/cpu_usage.py +++ b/.config/polybar/scripts/cpu_usage.py @@ -26,11 +26,11 @@ def show_cpu_usage(): bar = '' global_count = 0 for usage in cpu_usage.split(','): - value, key = str.lstrip(usage).split(' ') - count = round(float(value) / 10) - if count > 0 and key != 'id': + values = str.lstrip(usage).split(' ') + count = round(float(values[0]) / 10) + if count > 0 and values[1] != 'id': global_count += count - bar += '%{F' + colors[key] + '}' + '_' * count + '%{F-}' + bar += '%{F' + colors[values[1]] + '}' + '_' * count + '%{F-}' padding = '' if global_count < 10: