diff --git a/doc/tint2.1 b/doc/tint2.1 index 040c2be..c745986 100644 --- a/doc/tint2.1 +++ b/doc/tint2.1 @@ -831,19 +831,19 @@ execp_markup = 1 .PP .RS .nf +# Note the use of "stdbuf \-oL" to force the program to flush the output line by line. execp = new -execp_command = free | awk '/^\-/ { printf "Mem: '$(free \-h | awk '/^Mem:/ { print $2 }')' %.0f%%\\n", 100*$3/($3+$4); fflush(stdout) }' -execp_interval = 5 -execp_continuous = 0 +execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\n", $2, 100 * ($2 - $7) / $2 }' | stdbuf -oL numfmt --to=iec-i --field=2 -d' ' +execp_interval = 1 +execp_continuous = 1 .fi .RE .SS Network load .PP .RS .nf -# Note the use of "stdbuf \-oL" to force the program to flush the output line by line. execp = new -execp_command = stdbuf \-oL bwm\-ng \-o csv \-t 1000 | awk \-F ';' '/total/ { printf "Net: %.0f Mb/s\\n", ($5*8/1.0e6) }; fflush(stdout)' +execp_command = stdbuf \-oL bwm\-ng \-o csv \-t 1000 | stdbuf -oL awk \-F ';' '/total/ { printf "Net: %.0f Mb/s\\n", ($5*8/1.0e6) }' execp_continuous = 1 execp_interval = 1 .fi diff --git a/doc/tint2.html b/doc/tint2.html index 033dc77..2acd5ea 100644 --- a/doc/tint2.html +++ b/doc/tint2.html @@ -372,14 +372,14 @@ execp_continuous = 1 execp_interval = 1 execp_markup = 1 -
Memory usage
execp = new
-execp_command = free -s 2 | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%\n", 100*$3/($3+$4); fflush(stdout) }'
+
Memory usage
# Note the use of "stdbuf -oL" to force the program to flush the output line by line.
+execp = new
+execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\n", $2, 100 * ($2 - $7) / $2 }' | stdbuf -oL numfmt --to=iec-i --field=2 -d' '
 execp_interval = 1
 execp_continuous = 1
 
-
Network load
# Note the use of "stdbuf -oL" to force the program to flush the output line by line.
-execp = new
-execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }; fflush(stdout)'
+
Network load
execp = new
+execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | stdbuf -oL awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }'
 execp_continuous = 1
 execp_interval = 1
 
diff --git a/doc/tint2.md b/doc/tint2.md index 313f815..af52798 100644 --- a/doc/tint2.md +++ b/doc/tint2.md @@ -694,18 +694,18 @@ execp_markup = 1 ##### Memory usage ``` +# Note the use of "stdbuf -oL" to force the program to flush the output line by line. execp = new -execp_command = free | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%%\n", 100*$3/($3+$4); fflush(stdout) }' -execp_interval = 5 -execp_continuous = 0 +execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\n", $2, 100 * ($2 - $7) / $2 }' | stdbuf -oL numfmt --to=iec-i --field=2 -d' ' +execp_interval = 1 +execp_continuous = 1 ``` ##### Network load ``` -# Note the use of "stdbuf -oL" to force the program to flush the output line by line. execp = new -execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }; fflush(stdout)' +execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | stdbuf -oL awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }' execp_continuous = 1 execp_interval = 1 ```