summaryrefslogtreecommitdiff
path: root/i3status.c
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@users.noreply.github.com>2016-07-30 19:23:20 +0200
committerGitHub <noreply@github.com>2016-07-30 19:23:20 +0200
commit8e852fa94554f4caa162256e5f6ce2413027100b (patch)
tree373a3fbf687ff7fb8d5d0ee405b46dd8736d499f /i3status.c
parentdd0f6bf4b76e6431b3d51abceef42fd60bfb16b5 (diff)
parentdbc0f9bd8c3561eb7b9c2d7c13518cb825695d23 (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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/i3status.c b/i3status.c
index e5e85bf..892d4aa 100644
--- a/i3status.c
+++ b/i3status.c
@@ -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;
}
}