]> git.sur5r.net Git - i3/i3status/blobdiff - i3status.c
bugfix: colorize output even without discharge rate (thanks f8l)
[i3/i3status] / i3status.c
index f0767a0555ac959a0f8257b713f0c9dc92584d42..5d3153cea5c97731ba5f61436e34ee0ec1df21db 100644 (file)
@@ -214,7 +214,8 @@ int main(int argc, char *argv[]) {
         cfg_opt_t battery_opts[] = {
                 CFG_STR("format", "%status %percentage %remaining", CFGF_NONE),
                 CFG_STR("path", "/sys/class/power_supply/BAT%d/uevent", CFGF_NONE),
-                CFG_INT("low_threshold", 10, CFGF_NONE),
+                CFG_INT("low_threshold", 30, CFGF_NONE),
+                CFG_STR("threshold_type", "time", CFGF_NONE),
                 CFG_BOOL("last_full_capacity", false, CFGF_NONE),
                 CFG_END()
         };
@@ -242,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()
         };
 
@@ -414,7 +416,7 @@ int main(int argc, char *argv[]) {
 
                         CASE_SEC_TITLE("battery") {
                                 SEC_OPEN_MAP("battery");
-                                print_battery_info(json_gen, buffer, atoi(title), cfg_getstr(sec, "path"), cfg_getstr(sec, "format"), cfg_getint(sec, "low_threshold"), cfg_getbool(sec, "last_full_capacity"));
+                                print_battery_info(json_gen, buffer, atoi(title), cfg_getstr(sec, "path"), cfg_getstr(sec, "format"), cfg_getint(sec, "low_threshold"), cfg_getstr(sec, "threshold_type"), cfg_getbool(sec, "last_full_capacity"));
                                 SEC_CLOSE_MAP;
                         }
 
@@ -459,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;
                         }