Clean text when 100%

This commit is contained in:
Thomas Forgione 2026-03-09 14:28:08 +01:00
parent e8aa6f25cd
commit e236b4723e

View File

@ -247,8 +247,9 @@ def monitor_stats():
else: else:
battery_class = None battery_class = None
battery_text = "% 4.0f" % battery.percent if battery_percent <= 99.95 else " 100"
battery_json = f', "class": "{battery_class}"' if battery_class else '' battery_json = f', "class": "{battery_class}"' if battery_class else ''
battery_json = '{"text": "' + battery_icon + ' ' + "% 4.0f" % battery.percent + '%"' + battery_json + '}' battery_json = '{"text": "' + battery_icon + ' ' + battery_text + '%"' + battery_json + '}'
cpu_percent_text = "% 5.1f" % cpu_percent if cpu_percent <= 99.95 else " 100" cpu_percent_text = "% 5.1f" % cpu_percent if cpu_percent <= 99.95 else " 100"
mem_percent_text = "% 5.1f" % mem_percent if mem_percent <= 99.95 else " 100" mem_percent_text = "% 5.1f" % mem_percent if mem_percent <= 99.95 else " 100"