summaryrefslogtreecommitdiff
path: root/i3status.c
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@openbsd.org>2012-10-10 09:57:32 +0200
committerMichael Stapelberg <michael@stapelberg.de>2012-10-16 10:51:15 +0200
commitae4873bac793245e7dea4719c8e0d1c7bc990d5f (patch)
tree5d17159a3ccf4e850cc861e15c07ab9cedcb6eae /i3status.c
parent1c2517a3998385dbfca0559aca3ba7e72b5c216c (diff)
i3status - More temperature related fixes for OpenBSD, and a general feature
- Temperature sensors can now set a 'max_threshold' value to color the output red if exceeded. - Allow for arbitrary temperature sensors nodes to be selected with 'path' on OpenBSD.
Diffstat (limited to 'i3status.c')
-rw-r--r--i3status.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/i3status.c b/i3status.c
index 915cbcc..5d3153c 100644
--- a/i3status.c
+++ b/i3status.c
@@ -243,6 +243,7 @@ int main(int argc, char *argv[]) {
cfg_opt_t temp_opts[] = {
CFG_STR("format", "%degrees C", CFGF_NONE),
CFG_STR("path", NULL, CFGF_NONE),
+ CFG_INT("max_threshold", 75, CFGF_NONE),
CFG_END()
};
@@ -460,7 +461,7 @@ int main(int argc, char *argv[]) {
CASE_SEC_TITLE("cpu_temperature") {
SEC_OPEN_MAP("cpu_temperature");
- print_cpu_temperature_info(json_gen, buffer, atoi(title), cfg_getstr(sec, "path"), cfg_getstr(sec, "format"));
+ print_cpu_temperature_info(json_gen, buffer, atoi(title), cfg_getstr(sec, "path"), cfg_getstr(sec, "format"), cfg_getint(sec, "max_threshold"));
SEC_CLOSE_MAP;
}