all repos — tint2 @ 975149642fccd9edb663d86d8630637ea5800d4e

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

Use numfmt to get back human output in memory usage executor
Nikita Zlobin nick87720z@gmail.com
commit

975149642fccd9edb663d86d8630637ea5800d4e

parent

bba945b3b967f1095388bf030196dba46d6a110f

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

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

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

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

@@ -372,9 +372,9 @@ 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># "stdbuf -oL" noticed to give better performance than fflush() from awk code +<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># 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 &lsquo;/^Mem:/ { c=&ldquo;numfmt &ndash;to=si&rdquo;; print $2 |&amp; c; c |&amp; getline a; printf &ldquo;Mem: %s %.0f%%\n&rdquo;, a, 100 * ($2 - $7) / $2 }&rsquo; execp_interval = 1 execp_continuous = 1 </code></pre>
M doc/tint2.mddoc/tint2.md

@@ -694,9 +694,9 @@

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