cfg_opt_t battery_opts[] = {
CFG_STR("format", "%status %percentage %remaining", CFGF_NONE),
+ CFG_STR("format_down", "No battery", CFGF_NONE),
CFG_STR("path", "/sys/class/power_supply/BAT%d/uevent", 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_BOOL("integer_battery_capacity", false, CFGF_NONE),
CFG_CUSTOM_COLOR_OPTS,
CFG_END()
};
cfg_opt_t load_opts[] = {
CFG_STR("format", "%1min %5min %15min", CFGF_NONE),
+ CFG_INT("max_threshold", 5, CFGF_NONE),
+ CFG_CUSTOM_COLOR_OPTS,
CFG_END()
};
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_getstr(sec, "threshold_type"), cfg_getbool(sec, "last_full_capacity"));
+ print_battery_info(json_gen, buffer, atoi(title), cfg_getstr(sec, "path"), cfg_getstr(sec, "format"), cfg_getstr(sec, "format_down"), cfg_getint(sec, "low_threshold"), cfg_getstr(sec, "threshold_type"), cfg_getbool(sec, "last_full_capacity"), cfg_getbool(sec, "integer_battery_capacity"));
SEC_CLOSE_MAP;
}
CASE_SEC("load") {
SEC_OPEN_MAP("load");
- print_load(json_gen, buffer, cfg_getstr(sec, "format"));
+ print_load(json_gen, buffer, cfg_getstr(sec, "format"), cfg_getint(sec, "max_threshold"));
SEC_CLOSE_MAP;
}