*
* i3status – Generates a status line for dzen2 or xmobar
*
- * Copyright © 2008-2011 Michael Stapelberg and contributors
+ * Copyright © 2008-2012 Michael Stapelberg and contributors
* Copyright © 2009 Thorsten Toepper <atsutane at freethoughts dot de>
* Copyright © 2010 Axel Wagner <mail at merovius dot de>
* Copyright © 2010 Fernando Tarlá Cardoso Lemos <fernandotcl at gmail dot com>
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 */
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", 30, CFGF_NONE),
+ CFG_STR("threshold_type", "time", CFGF_NONE),
CFG_BOOL("last_full_capacity", false, CFGF_NONE),
CFG_END()
};
if ((char)o == 'c')
configfile = optarg;
else if ((char)o == 'h') {
- printf("i3status " VERSION " © 2008-2011 Michael Stapelberg and contributors\n"
+ printf("i3status " VERSION " © 2008-2012 Michael Stapelberg and contributors\n"
"Syntax: %s [-c <configfile>] [-h] [-v]\n", argv[0]);
return 0;
} else if ((char)o == 'v') {
- printf("i3status " VERSION " © 2008-2011 Michael Stapelberg and contributors\n");
+ printf("i3status " VERSION " © 2008-2012 Michael Stapelberg and contributors\n");
return 0;
}
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_getstr(sec, "threshold_type"), cfg_getbool(sec, "last_full_capacity"));
SEC_CLOSE_MAP;
}