From 31f2e3ef1d3a2f5e786a4917e18144297fd21dd4 Mon Sep 17 00:00:00 2001 From: Johannes Kamprad Date: Tue, 8 Feb 2022 17:04:32 +0100 Subject: [PATCH] Update cpu_usage changed: printf "%.${decimals}f%%\n", $cpu_usage; to: printf "%02.${decimals}f%%\n", $cpu_usage; lines 50 + 52 for this: always print two digits (leading zero) in front of the decimal point see here: https://forum.endeavouros.com/t/min-width-cpu-100-00/21129/2?u=joekamprad --- .config/i3/scripts/cpu_usage | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/i3/scripts/cpu_usage b/.config/i3/scripts/cpu_usage index d12e5d6..8d8a267 100644 --- a/.config/i3/scripts/cpu_usage +++ b/.config/i3/scripts/cpu_usage @@ -47,9 +47,9 @@ $cpu_usage eq -1 and die 'Can\'t find CPU information'; # Print short_text, full_text print "${label}"; -printf "%.${decimals}f%%\n", $cpu_usage; +printf "%02.${decimals}f%%\n", $cpu_usage; print "${label}"; -printf "%.${decimals}f%%\n", $cpu_usage; +printf "%02.${decimals}f%%\n", $cpu_usage; # Print color, if needed if ($cpu_usage >= $t_crit) {