From 572c96d63ed41bfc83d7378454f3ae4505ad9601 Mon Sep 17 00:00:00 2001 From: MK13 Date: Sat, 26 Oct 2019 15:32:32 +0200 Subject: Introduce memory options 'unit' and 'decimals' Previously the format placeholders were auto-converted to the maximum possible unit, e.g. /proc/meminfo reports MemTotal of 16307104kB which will get converted to 15.6GiB. It is now possible to specifiy the target unit, e.g. Mi, which will be used for the conversion - in the example it would lead to 15924.9MiB. The resulting number can now be further formatted via the decimal option. It allows to specify the number of decimals to use, e.g. 15.6GiB vs. 15GiB or 15924.9MiB vs. 15925MiB. --- man/i3status.man | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'man') diff --git a/man/i3status.man b/man/i3status.man index 9283722..4cfa7d8 100644 --- a/man/i3status.man +++ b/man/i3status.man @@ -463,6 +463,15 @@ If the +format_degraded+ parameter is given and either the critical or the degraded threshold applies, +format_degraded+ will get used as format string. It acts equivalently to +format+. +It's also possible to define the unit for the various format placeholders. As ++/proc/meminfo+ returns the memory in kB they will be converted to the given +unit. If no unit is given or the +auto+ option is used, the conversion will +select the maximum possible unit. + +As the converted format placeholder will be a decimal number, the number of +decimals can be configured via the +decimals+ option. If no such option is +given the converted format placeholder will have one decimal. + As Linux' meminfo doesn't expose the overall memory in use, there are multiple methods to distinguish the actually used memory. @@ -476,6 +485,10 @@ methods to distinguish the actually used memory. *Example format*: +%percentage_used used, %percentage_free free, %percentage_shared shared+ +*Example unit*: auto, Ki, Mi, Gi, Ti + +*Example decimals*: 0, 1, 2, 3 + *Example threshold_degraded*: +10%+ *Example threshold_critical*: +5%+ -- cgit v1.2.3