all repos — tint2 @ b56147efb7418086912bed90cd5141a1e728732f

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Merge branch 'executor-example-memusage' into 'master'

Enhanced example for memusage executor

Closes #787

See merge request o9000/tint2!38
Chris chrlee@protonmail.com
commit

b56147efb7418086912bed90cd5141a1e728732f

parent

5b3f9c4662babaff4d396618efb384a3967ae8e9

3 files changed, 15 insertions(+), 15 deletions(-)

jump to
M doc/tint2.1doc/tint2.1

@@ -831,19 +831,19 @@ .SS Memory usage

.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
M doc/tint2.htmldoc/tint2.html

@@ -372,14 +372,14 @@ execp_continuous = 1

execp_interval = 1 execp_markup = 1 </code></pre> -<h5 id="memory-usage">Memory usage<a name="memory-usage" href="#memory-usage" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>execp = new -execp_command = free -s 2 | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%\n", 100*$3/($3+$4); fflush(stdout) }' +<h5 id="memory-usage">Memory usage<a name="memory-usage" href="#memory-usage" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code># 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 </code></pre> -<h5 id="network-load">Network load<a name="network-load" href="#network-load" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code># 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)' +<h5 id="network-load">Network load<a name="network-load" href="#network-load" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>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 </code></pre>
M doc/tint2.mddoc/tint2.md

@@ -694,18 +694,18 @@

##### 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 ```