X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fi3status.h;h=93f979142abed204128fb4383149dc0adcd96ecc;hb=1c2517a3998385dbfca0559aca3ba7e72b5c216c;hp=43110548ff20f58a9acdea3131ae428f59c38d80;hpb=0686906b892aba4df014d440c313610bfac513e0;p=i3%2Fi3status diff --git a/include/i3status.h b/include/i3status.h index 4311054..93f9791 100644 --- a/include/i3status.h +++ b/include/i3status.h @@ -7,6 +7,7 @@ enum { O_DZEN2, O_XMOBAR, O_I3BAR, O_NONE } output_format; #include #include #include +#include #include #include @@ -25,6 +26,17 @@ enum { O_DZEN2, O_XMOBAR, O_I3BAR, O_NONE } output_format; #define BATT_TIME "hw.acpi.battery.time" #define BATT_STATE "hw.acpi.battery.state" +#elif defined(__OpenBSD__) +/* + * 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: + * 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 "acpitz%d" + #endif #if defined(__FreeBSD_kernel__) && defined(__GLIBC__) @@ -84,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) @@ -127,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();