]> git.sur5r.net Git - i3/i3status/commitdiff
rename threshold to low_threshold and document it properly
authorMichael Stapelberg <michael@stapelberg.de>
Fri, 25 May 2012 07:57:03 +0000 (09:57 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 25 May 2012 07:57:03 +0000 (09:57 +0200)
i3status.c
man/i3status.man

index e812893cf0e3c01862c24f1b75720ac1d89272b9..f0767a0555ac959a0f8257b713f0c9dc92584d42 100644 (file)
@@ -214,7 +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_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_INT("low_threshold", 10, CFGF_NONE),
                 CFG_BOOL("last_full_capacity", false, CFGF_NONE),
                 CFG_END()
         };
                 CFG_BOOL("last_full_capacity", false, CFGF_NONE),
                 CFG_END()
         };
@@ -414,7 +414,7 @@ int main(int argc, char *argv[]) {
 
                         CASE_SEC_TITLE("battery") {
                                 SEC_OPEN_MAP("battery");
 
                         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, "threshold"), 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;
                         }
 
                                 SEC_CLOSE_MAP;
                         }
 
index 7f8875096f4545f9298057b75c3d2a32ef7d70d5..7df3d9d58f3fa509ef66edc850087716932a6c05 100644 (file)
@@ -72,7 +72,7 @@ ethernet eth0 {
 battery 0 {
         format = "%status %percentage %remaining %emptytime"
         path = "/sys/class/power_supply/BAT%d/uevent"
 battery 0 {
         format = "%status %percentage %remaining %emptytime"
         path = "/sys/class/power_supply/BAT%d/uevent"
-        threshold = 10
+        low_threshold = 10
 }
 
 run_watch DHCP {
 }
 
 run_watch DHCP {
@@ -204,11 +204,15 @@ If your battery is represented in a non-standard path in /sys, be sure to
 modify the "path" property accordingly. The first occurence of %d gets replaced
 with the battery number, but you can just hard-code a path as well.
 
 modify the "path" property accordingly. The first occurence of %d gets replaced
 with the battery number, but you can just hard-code a path as well.
 
+If the remaining time sinks below low_threshold minutes, the battery text will
+be colored red. So, if you configure low_threshold to 10, and your battery
+lasts another 9 minutes, it will be colored red.
+
 *Example order*: +battery 0+
 
 *Example format*: +%status %remaining (%emptytime)+
 
 *Example order*: +battery 0+
 
 *Example format*: +%status %remaining (%emptytime)+
 
-*Example threshold*: +threshold 10+
+*Example low_threshold*: +low_threshold 10+
 
 === CPU-Temperature
 
 
 === CPU-Temperature