From 1e8dab273d8542366c098dfcda37756db6b2bcd7 Mon Sep 17 00:00:00 2001 From: Mark Schreiber Date: Wed, 13 Apr 2016 09:07:12 -0700 Subject: Add CPU usage color thresholds CPU usage had previously not supported the color option. Add support for a "degraded" state above which the degraded color is used, and a higher "bad" state above which the "bad" color is used. One possible use for these might be indicating whether one or all cores are saturated. Unlike the color settings for other, these are set high enough to be disabled by default. This is done because i3status determines CPU usage over only the last display interval, which means that, a user with a low refresh rate might see frequent, potentially-annoying color changes. --- include/i3status.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/i3status.h') diff --git a/include/i3status.h b/include/i3status.h index 7e756e2..b4cf83f 100644 --- a/include/i3status.h +++ b/include/i3status.h @@ -216,7 +216,7 @@ void print_wireless_info(yajl_gen json_gen, char *buffer, const char *interface, void print_run_watch(yajl_gen json_gen, char *buffer, const char *title, const char *pidfile, const char *format, const char *format_down); void print_path_exists(yajl_gen json_gen, char *buffer, const char *title, const char *path, const char *format, const char *format_down); void print_cpu_temperature_info(yajl_gen json_gen, char *buffer, int zone, const char *path, const char *format, int); -void print_cpu_usage(yajl_gen json_gen, char *buffer, const char *format); +void print_cpu_usage(yajl_gen json_gen, char *buffer, const char *format, 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 float max_threshold); 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); -- cgit v1.2.3