X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=home%2Flib%2Flogin_functions.sh;h=664636531884adab5a091e7de954ee02a244ace7;hb=48c2317325e496fdf5bd93ae91ce938401873bf2;hp=9f24d3e93968f0c81938a8c9484d43dc1eeb5186;hpb=ea9d43c930a633f22bf40c8f9b08abb1dce6bb8c;p=khome.git diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index 9f24d3e..6646365 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -389,9 +389,10 @@ bar_gauge() { cur_scaled = num_scale(cur, max, 1, width) printf \ - "%s%s%s", \ + "%s%s%s%s", \ lab ? lab " " : "", \ num ? cur "/" max " " : "", \ + pct ? sprintf("%3.0f%% ", cur / max * 100) : "", \ ch_left for (i=1; i<=width; i++) { c = i <= cur_scaled ? ch_used : ch_blank @@ -463,7 +464,7 @@ motd() { df ~ | awk 'NR == 2 {print $3, $3 + $4, "disk"}' motd_batt ) \ - | bar_gauge -v width="$bar_width" \ + | bar_gauge -v width="$bar_width" -v pct=1 \ | column -t \ | indent "$indent_unit"