From e236b4723e8cb143f8af9aea7ee674f4ad9d97d1 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Mon, 9 Mar 2026 14:28:08 +0100 Subject: [PATCH] Clean text when 100% --- hyprscript | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hyprscript b/hyprscript index eed1890..28f3384 100755 --- a/hyprscript +++ b/hyprscript @@ -247,8 +247,9 @@ def monitor_stats(): else: 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 = '{"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" mem_percent_text = "% 5.1f" % mem_percent if mem_percent <= 99.95 else " 100"