summaryrefslogtreecommitdiff
path: root/i3status.c
diff options
context:
space:
mode:
authorSimon Elsbrock <simon@iodev.org>2012-05-22 23:14:59 +0200
committerMichael Stapelberg <michael@stapelberg.de>2012-05-25 09:53:49 +0200
commit7c02c10b728a099a6d328df9cfd9a3f1c4b88702 (patch)
treef5203932e086b125987a8889c774bbd63854f012 /i3status.c
parent7a77472a810b0a955f2755dd028216965b56be31 (diff)
colorize battery output if remaining time below threshold
Diffstat (limited to 'i3status.c')
-rw-r--r--i3status.c3
1 files changed, 2 insertions, 1 deletions
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;
}