openbsd-ports/x11/i3status/patches/patch-i3status_c
2012-10-09 17:12:31 +00:00

25 lines
1.1 KiB
Plaintext

$OpenBSD: patch-i3status_c,v 1.1 2012/10/09 17:12:31 jasper Exp $
- Temperature sensors can now set a 'max_threshold' value to color the
output red if exceeded.
--- i3status.c.orig Tue Oct 9 20:35:06 2012
+++ i3status.c Tue Oct 9 20:35:15 2012
@@ -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;
}