From 7c02c10b728a099a6d328df9cfd9a3f1c4b88702 Mon Sep 17 00:00:00 2001 From: Simon Elsbrock Date: Tue, 22 May 2012 23:14:59 +0200 Subject: colorize battery output if remaining time below threshold --- i3status.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'i3status.c') diff --git a/i3status.c b/i3status.c index 15c58da..e812893 100644 --- a/i3status.c +++ b/i3status.c @@ -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("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, "threshold"), cfg_getbool(sec, "last_full_capacity")); SEC_CLOSE_MAP; } -- cgit v1.2.3