enum { O_DZEN2,
O_XMOBAR,
O_I3BAR,
+ O_LEMONBAR,
O_TERM,
O_NONE } output_format;
+char *pct_mark;
+
#include <stdbool.h>
#include <confuse.h>
#include <time.h>
#include <yajl/yajl_version.h>
#include <unistd.h>
#include <string.h>
+#include <pthread.h>
+#include <stdint.h>
#define BEGINS_WITH(haystack, needle) (strncmp(haystack, needle, strlen(needle)) == 0)
#define max(a, b) ((a) > (b) ? (a) : (b))
+#define DEFAULT_SINK_INDEX UINT32_MAX
+#define COMPOSE_VOLUME_MUTE(vol, mute) ((vol) | ((mute) ? (1 << 30) : 0))
+#define DECOMPOSE_VOLUME(cvol) ((cvol) & ~(1 << 30))
+#define DECOMPOSE_MUTED(cvol) (((cvol) & (1 << 30)) != 0)
+
#if defined(LINUX)
#define THERMAL_ZONE "/sys/class/thermal/thermal_zone%d/temp"
/* Allows for the definition of a variable without opening a new scope, thus
* suited for usage in a macro. Idea from wmii. */
#define with(type, var, init) \
- for (type var = (type)-1; (var == (type)-1) && ((var = (init)) || 1);)
+ for (type var = (type)-1; (var == (type)-1) && ((var = (init)) || 1); var = (type)1)
#define CASE_SEC(name) \
if (BEGINS_WITH(current, name)) \
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 *fmt_muted, const char *device, const char *mixer, int mixer_idx);
bool process_runs(const char *path);
+int volume_pulseaudio(uint32_t sink_idx);
+bool pulse_initialize(void);
/* socket file descriptor for general purposes */
extern int general_socket;
extern void **cur_instance;
+extern pthread_cond_t i3status_sleep_cond;
+extern pthread_mutex_t i3status_sleep_mutex;
+
#endif