home
/
code
/
khome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ea9d43c
)
Show percentages in resource utilization gauges
author
Siraaj Khandkar
<siraaj@khandkar.net>
Mon, 2 Nov 2020 10:46:16 +0000
(
05:46
-0500)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Mon, 2 Nov 2020 10:46:16 +0000
(
05:46
-0500)
home/lib/login_functions.sh
patch
|
blob
|
blame
|
history
diff --git
a/home/lib/login_functions.sh
b/home/lib/login_functions.sh
index
9f24d3e
..
6646365
100644
(file)
--- 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"
This page took
0.020089 seconds
and
4
git commands to generate.