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. --- include/i3status.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/i3status.h b/include/i3status.h index 217376a..7d22b21 100644 --- a/include/i3status.h +++ b/include/i3status.h @@ -225,7 +225,7 @@ void print_cpu_temperature_info(yajl_gen json_gen, char *buffer, int zone, const void print_cpu_usage(yajl_gen json_gen, char *buffer, const char *format, const char *format_above_threshold, const char *format_above_degraded_threshold, const char *path, const float max_threshold, const float degraded_threshold); void print_eth_info(yajl_gen json_gen, char *buffer, const char *interface, const char *format_up, const char *format_down); void print_load(yajl_gen json_gen, char *buffer, const char *format, const char *format_above_threshold, const float max_threshold); -void print_memory(yajl_gen json_gen, char *buffer, const char *format, const char *format_degraded, const char *threshold_degraded, const char *threshold_critical, const char *memory_used_method); +void print_memory(yajl_gen json_gen, char *buffer, const char *format, const char *format_degraded, const char *threshold_degraded, const char *threshold_critical, const char *memory_used_method, const char *unit, const int decimals); void print_volume(yajl_gen json_gen, char *buffer, const char *fmt, const char *fmt_muted, const char *device, const char *mixer, int mixer_idx); bool process_runs(const char *path); int volume_pulseaudio(uint32_t sink_idx, const char *sink_name); -- cgit v1.2.3