]> git.sur5r.net Git - i3/i3status/commitdiff
allow load to be a float
authorM. Kory Woods <kory@virlo.net>
Sun, 7 Jul 2013 15:54:50 +0000 (10:54 -0500)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 9 Jul 2013 21:22:26 +0000 (23:22 +0200)
i3status.c
include/i3status.h
src/print_load.c

index ded5799279472d902be652b4a10f5d4d3b9e8149..e99e627be4557d386bd5de1c301c6e91596f7750 100644 (file)
@@ -261,7 +261,7 @@ int main(int argc, char *argv[]) {
 
         cfg_opt_t load_opts[] = {
                 CFG_STR("format", "%1min %5min %15min", CFGF_NONE),
-                CFG_INT("max_threshold", 5, CFGF_NONE),
+                CFG_FLOAT("max_threshold", 5, CFGF_NONE),
                 CFG_CUSTOM_COLOR_OPTS,
                 CFG_END()
         };
@@ -488,7 +488,7 @@ int main(int argc, char *argv[]) {
 
                         CASE_SEC("load") {
                                 SEC_OPEN_MAP("load");
-                                print_load(json_gen, buffer, cfg_getstr(sec, "format"), cfg_getint(sec, "max_threshold"));
+                                print_load(json_gen, buffer, cfg_getstr(sec, "format"), cfg_getfloat(sec, "max_threshold"));
                                 SEC_CLOSE_MAP;
                         }
 
index 8185d38e75a16435d6d8fc50175ae5418cf2f1da..5d8d27b2a91c38fb6e1c9fe63ab2ecdc3ed1c652 100644 (file)
@@ -152,7 +152,7 @@ void print_run_watch(yajl_gen json_gen, char *buffer, const char *title, const c
 void print_cpu_temperature_info(yajl_gen json_gen, char *buffer, int zone, const char *path, const char *format, int);
 void print_cpu_usage(yajl_gen json_gen, char *buffer, const char *format);
 void print_eth_info(yajl_gen json_gen, char *buffer, const char *interface, const char *format_up, const char *format_down);
-void print_load(yajl_gen json_gen, char *buffer, const char *format, const int max_threshold);
+void print_load(yajl_gen json_gen, char *buffer, const char *format, const float max_threshold);
 void print_volume(yajl_gen json_gen, char *buffer, const char *fmt, const char *device, const char *mixer, int mixer_idx);
 bool process_runs(const char *path);
 
index 4e026cc854db3e7c4a6bb3dd0e2f86f0c2e43e20..6e61ae694bcee3b52746c294ce14a577c170fda0 100644 (file)
@@ -6,7 +6,7 @@
 #include <yajl/yajl_gen.h>
 #include <yajl/yajl_version.h>
 
-void print_load(yajl_gen json_gen, char *buffer, const char *format, const int max_threshold) {
+void print_load(yajl_gen json_gen, char *buffer, const char *format, const float max_threshold) {
         char *outwalk = buffer;
         /* Get load */