diff options
author | Michael Stapelberg <stapelberg@users.noreply.github.com> | 2016-07-30 19:23:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-30 19:23:20 +0200 |
commit | 8e852fa94554f4caa162256e5f6ce2413027100b (patch) | |
tree | 373a3fbf687ff7fb8d5d0ee405b46dd8736d499f /i3status.c | |
parent | dd0f6bf4b76e6431b3d51abceef42fd60bfb16b5 (diff) | |
parent | dbc0f9bd8c3561eb7b9c2d7c13518cb825695d23 (diff) |
Merge pull request #139 from Gjum/wb-colored-cpu-usage
Add CPU usage color thresholds
Diffstat (limited to 'i3status.c')
-rw-r--r-- | i3status.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -412,7 +412,10 @@ int main(int argc, char *argv[]) { cfg_opt_t usage_opts[] = { CFG_STR("format", "%usage", CFGF_NONE), + CFG_FLOAT("max_threshold", 95, CFGF_NONE), + CFG_FLOAT("degraded_threshold", 90, CFGF_NONE), CFG_CUSTOM_ALIGN_OPT, + CFG_CUSTOM_COLOR_OPTS, CFG_CUSTOM_MIN_WIDTH_OPT, CFG_CUSTOM_SEPARATOR_OPT, CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT, @@ -725,7 +728,7 @@ int main(int argc, char *argv[]) { CASE_SEC("cpu_usage") { SEC_OPEN_MAP("cpu_usage"); - print_cpu_usage(json_gen, buffer, cfg_getstr(sec, "format")); + print_cpu_usage(json_gen, buffer, cfg_getstr(sec, "format"), cfg_getfloat(sec, "max_threshold"), cfg_getfloat(sec, "degraded_threshold")); SEC_CLOSE_MAP; } } |