From e8aa6f25cdf9681d99f71bc7fb68cab33cc6dd02 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Mon, 9 Mar 2026 14:25:59 +0100 Subject: [PATCH] Clean text when 100% --- hyprscript | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hyprscript b/hyprscript index 7d73961..eed1890 100755 --- a/hyprscript +++ b/hyprscript @@ -250,10 +250,13 @@ def monitor_stats(): battery_json = f', "class": "{battery_class}"' if battery_class else '' battery_json = '{"text": "' + battery_icon + ' ' + "% 4.0f" % battery.percent + '%"' + 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" + with open('.stat.txt', 'w') as f: f.write( - ' ' + ''.join([to_bar(x) for x in cpu_values]) + ' ' + "% 5.1f" % cpu_percent + '%\n' + - ' ' + ''.join([to_bar(x) for x in mem_values]) + ' ' + "% 5.1f" % mem_percent + '%\n' + + ' ' + ''.join([to_bar(x) for x in cpu_values]) + ' ' + cpu_percent_text + '%\n' + + ' ' + ''.join([to_bar(x) for x in mem_values]) + ' ' + mem_percent_text + '%\n' + '  ' + ''.join([to_bar(x) for x in temp_values]) + ' ' + "% 5.1f" % temp + '°\n' + battery_json )