diff --git a/doc/tint2.1 b/doc/tint2.1 index c985bca..3d62190 100644 --- a/doc/tint2.1 +++ b/doc/tint2.1 @@ -831,9 +831,9 @@ execp_markup = 1 .PP .RS .nf -# "stdbuf -oL" noticed to give better performance than fflush() from awk code +# Though unnecessary here, "stdbuf -oL" performs better than fflush() in awk code execp = new -execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %.1fGi %.0f%%\n", $2 / (2^30), 100 * ($2 - $7) / $2 }' +execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { c="numfmt --to=si"; print $2 |& c; c |& getline a; printf "Mem: %s %.0f%%\n", a, 100 * ($2 - $7) / $2 }' execp_interval = 1 execp_continuous = 1 .fi diff --git a/doc/tint2.html b/doc/tint2.html index 7266ab0..44cd3da 100644 --- a/doc/tint2.html +++ b/doc/tint2.html @@ -372,9 +372,9 @@ execp_continuous = 1 execp_interval = 1 execp_markup = 1 -
Memory usage
# "stdbuf -oL" noticed to give better performance than fflush() from awk code
+
Memory usage
# Though unnecessary here, "stdbuf -oL" performs better than fflush() in awk code
 execp = new
-execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %.1fGi %.0f%%\n", $2 / (2^30), 100 * ($2 - $7) / $2 }'
+execp_command = free -b -s1 | stdbuf -oL awk ‘/^Mem:/ { c=“numfmt –to=si”; print $2 |& c; c |& getline a; printf “Mem: %s %.0f%%\n”, a, 100 * ($2 - $7) / $2 }’
 execp_interval = 1
 execp_continuous = 1
 
diff --git a/doc/tint2.md b/doc/tint2.md index 5b6b1b9..d1a27b1 100644 --- a/doc/tint2.md +++ b/doc/tint2.md @@ -694,9 +694,9 @@ execp_markup = 1 ##### Memory usage ``` -# "stdbuf -oL" noticed to give better performance than fflush() from awk code +# Though unnecessary here, "stdbuf -oL" performs better than fflush() in awk code execp = new -execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %.1fGi %.0f%%\n", $2 / (2^30), 100 * ($2 - $7) / $2 }' +execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { c="numfmt --to=si"; print $2 |& c; c |& getline a; printf "Mem: %s %.0f%%\n", a, 100 * ($2 - $7) / $2 }' execp_interval = 1 execp_continuous = 1 ```