summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortslil clingman <>2023-12-14 22:19:04 +0100
committertslil clingman <>2023-12-14 22:19:04 +0100
commit9268a49def2f8e6e829f27e448269e7604a75b9a (patch)
tree08bc67f8ac3145723018157a6cd80f0431a8a431
parentfb9e55809afe7a2cecd80c523a37cb197970f9c5 (diff)
battery: always two-digit minutes
-rwxr-xr-xbattery2
1 files changed, 1 insertions, 1 deletions
diff --git a/battery b/battery
index 8e6caa9..c1ebb6e 100755
--- a/battery
+++ b/battery
@@ -12,7 +12,7 @@ END { if (status=="Full"||status=="Unknown") {
if (status=="Charging") {q = q_full - q_now} else {q = q_now};
h=q/i_now;
m=(h-int(h))*60;
- printf("%s%d%% %dh%dm\n",
+ printf("%s%d%% %dh%02dm\n",
substr(status, 0, 1),
perc,
h, m);