]> git.sur5r.net Git - i3/i3status/blobdiff - include/i3status.h
i3status - Default to acpitz(4) instead of cpu(4) for OpenBSD temperature readings
[i3/i3status] / include / i3status.h
index a6d5fc6ce4eecec9f68dab948ae191da0166ee2e..93f979142abed204128fb4383149dc0adcd96ecc 100644 (file)
@@ -31,9 +31,11 @@ enum { O_DZEN2, O_XMOBAR, O_I3BAR, O_NONE } output_format;
  * Due to the fact there are various ways to obtain a temperature reading, THERMAL_ZONE will need
  * to be adjustable enough for those situations. As it can either be hw.sensors.cpu%d.temp0, or
  * hw.sensors.acpitz%d.temp0 or even something different entirely within hw.sensors.%s.temp0.
- * XXX: For now just check cpu%d.temp0. Adjust this later.
+ * XXX:
+ * Due to the fact the i3status API only allows to set the THERMAL_ZONE parameter to an integer,
+ * we can't make this fully configureable (yet?).
  */
-#define THERMAL_ZONE "cpu%d"
+#define THERMAL_ZONE "acpitz%d"
 
 #endif
 
@@ -94,12 +96,12 @@ enum { O_DZEN2, O_XMOBAR, O_I3BAR, O_NONE } output_format;
 #define START_COLOR(colorstr) \
        do { \
                if (cfg_getbool(cfg_general, "colors")) { \
-                       const char *val = cfg_getstr(cfg_general, colorstr); \
+                       const char *_val = cfg_getstr(cfg_general, colorstr); \
                        if (output_format == O_I3BAR) { \
                                yajl_gen_string(json_gen, (const unsigned char *)"color", strlen("color")); \
-                               yajl_gen_string(json_gen, (const unsigned char *)val, strlen(val)); \
+                               yajl_gen_string(json_gen, (const unsigned char *)_val, strlen(_val)); \
                        } else { \
-                               outwalk += sprintf(outwalk, "%s", color("color_bad")); \
+                               outwalk += sprintf(outwalk, "%s", color(colorstr)); \
                        } \
                } \
        } while (0)
@@ -137,7 +139,7 @@ char *auto_detect_format();
 
 void print_ipv6_info(yajl_gen json_gen, char *buffer, const char *format_up, const char *format_down);
 void print_disk_info(yajl_gen json_gen, char *buffer, const char *path, const char *format);
-void print_battery_info(yajl_gen json_gen, char *buffer, int number, const char *path, const char *format, bool last_full_capacity);
+void print_battery_info(yajl_gen json_gen, char *buffer, int number, const char *path, const char *format, int low_threshold, char *threshold_type, bool last_full_capacity);
 void print_time(yajl_gen json_gen, char *buffer, const char *format, struct tm *current_tm);
 void print_ddate(yajl_gen json_gen, char *buffer, const char *format, struct tm *current_tm);
 const char *get_ip_addr();