]> git.sur5r.net Git - i3/i3status/blobdiff - i3status.c
rename threshold to low_threshold and document it properly
[i3/i3status] / i3status.c
index 3c5e3ce06e2246316c5bd71dc0751669ed8937e6..f0767a0555ac959a0f8257b713f0c9dc92584d42 100644 (file)
@@ -121,7 +121,7 @@ static char *resolve_tilde(const char *path) {
         return result;
 }
 
-static char *get_config_path() {
+static char *get_config_path(void) {
         char *xdg_config_home, *xdg_config_dirs, *config_path;
 
         /* 1: check the traditional path under the home directory */
@@ -214,6 +214,7 @@ 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_BOOL("last_full_capacity", false, CFGF_NONE),
                 CFG_END()
         };
@@ -413,7 +414,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_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_getbool(sec, "last_full_capacity"));
                                 SEC_CLOSE_MAP;
                         }