X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3status;a=blobdiff_plain;f=i3status.h;h=aa7f20e39a1953da7ba8ba2544584c436ea36591;hp=9edea1587780dcff11a8b56f264b5ae47048c9c4;hb=1c0e5ea560869092a7779c9d5984ded6848794ce;hpb=34ba9fa9083c655e5ba06cecd46da157eb07d980 diff --git a/i3status.h b/i3status.h index 9edea15..aa7f20e 100644 --- a/i3status.h +++ b/i3status.h @@ -5,13 +5,17 @@ #include "queue.h" -#define BAR "^fg(#333333)^p(5;-2)^ro(2)^p()^fg()^p(5)" +#ifdef DZEN + #define BAR "^fg(#333333)^p(5;-2)^ro(2)^p()^fg()^p(5)" +#elif XMOBAR + #define BAR " | " +#endif #define BEGINS_WITH(haystack, needle) (strncmp(haystack, needle, strlen(needle)) == 0) #define max(a, b) (a > b ? a : b) #define generate(orderidx, name, function) \ do { \ - write_to_statusbar(order_to_str(order[orderidx], name), function, (j == (MAX_ORDER-1))); \ + write_to_statusbar(order_to_str(order[orderidx], name), function, (j == (highest_order-1))); \ } while (0) #define generate_order(condition, orderidx, name, function) \ @@ -20,6 +24,25 @@ generate(orderidx, name, function); \ } while (0) +#if defined(LINUX) + +#define THERMAL_ZONE "/sys/class/thermal/thermal_zone%d/temp" + +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + +#define THERMAL_ZONE "hw.acpi.thermal.tz%d.temperature" +#define BATT_LIFE "hw.acpi.battery.life" +#define BATT_TIME "hw.acpi.battery.time" +#define BATT_STATE "hw.acpi.battery.state" + +#endif + +#if defined(__FreeBSD_kernel__) && defined(__GLIBC__) + +#include +#include + +#endif typedef enum { CS_DISCHARGING, CS_CHARGING, CS_FULL } charging_status_t; enum { ORDER_RUN, ORDER_WLAN, ORDER_ETH, ORDER_BATTERY, ORDER_CPU_TEMPERATURE, ORDER_LOAD, ORDER_TIME, ORDER_IPV6, MAX_ORDER }; @@ -38,11 +61,12 @@ void create_file(const char *name); char *order_to_str(int number, char *name); void setup(void); void write_to_statusbar(const char *name, const char *message, bool final_entry); -void slurp(char *filename, char *destination, int size); +bool slurp(char *filename, char *destination, int size); /* src/output.c */ void write_error_to_statusbar(const char *message); char *color(const char *colorstr); +char *endcolor() __attribute__ ((pure)); void cleanup_rbar_dir(); /* src/config.c */ @@ -63,9 +87,11 @@ extern struct battery_head batteries; /* socket file descriptor for general purposes */ extern int general_socket; +extern int highest_order; + extern const char *wlan_interface; extern const char *eth_interface; -extern const char *wmii_path; +extern char *wmii_path; extern const char *time_format; extern bool use_colors; extern bool get_ethspeed;