OBJ(battery_percent) {
percent_print(p, p_max_size, get_battery_perct(obj->data.s));
}
+#ifdef X11
OBJ(battery_bar) {
new_bar(p, obj->a, obj->b, get_battery_perct_bar(obj->data.s));
}
+#endif
OBJ(battery_short) {
get_battery_short_status(p, p_max_size, obj->data.s);
}
percent_print(p, p_max_size,
round_to_int(cur->cpu_usage[obj->data.cpu_index] * 100.0));
}
+#ifdef X11
OBJ(cpugauge)
new_gauge(p, obj->a, obj->b,
round_to_int(cur->cpu_usage[obj->data.cpu_index] * 255.0));
OBJ(color9) {
new_fg(p, color9);
}
+#endif
OBJ(conky_version) {
snprintf(p, p_max_size, "%s", VERSION);
}
get_obsd_product(p, p_max_size);
}
#endif /* __OpenBSD__ */
-
+#ifdef X11
OBJ(font) {
new_font(p, obj->data.s);
}
+#endif
/* TODO: move this correction from kB to kB/s elsewhere
* (or get rid of it??) */
OBJ(diskio) {
human_readable((obj->data.diskio->current_read / update_interval) * 1024LL,
p, p_max_size);
}
+#ifdef X11
OBJ(diskiograph) {
new_graph(p, obj->a, obj->b, obj->c, obj->d,
obj->data.diskio->current, obj->e, 1, obj->showaslog);
new_graph(p, obj->a, obj->b, obj->c, obj->d,
obj->data.diskio->current_write, obj->e, 1, obj->showaslog);
}
+#endif
OBJ(downspeed) {
human_readable(obj->data.net->recv_speed, p, 255);
}
spaced_print(p, p_max_size, "%.1f", 8,
obj->data.net->recv_speed / 1024.0);
}
+#ifdef X11
OBJ(downspeedgraph) {
- new_graph(p, obj->a, obj->b, obj->c, obj->d,
- obj->data.net->recv_speed / 1024.0, obj->e, 1, obj->showaslog);
+ new_graph(p, obj->a, obj->b, obj->c, obj->d,
+ obj->data.net->recv_speed / 1024.0, obj->e, 1, obj->showaslog);
}
+#endif
OBJ(else) {
/* Since we see you, you're if has not jumped.
* Do Ninja jump here: without leaving traces.
free_text_objects(&subroot);
free(tmp_info);
}
+#ifdef X11
OBJ(execgauge) {
double barnum;
}
new_gauge(p, obj->a, obj->b, round_to_int(obj->f));
}
+#endif
OBJ(execi) {
if (current_update_time - obj->data.execi.last_update
>= obj->data.execi.interval
timed_thread_unlock(mail->p_timed_thread);
}
}
+#ifdef X11
OBJ(fs_bar) {
if (obj->data.fs != NULL) {
if (obj->data.fs->size == 0) {
}
}
}
+#endif
OBJ(fs_free) {
if (obj->data.fs != NULL) {
human_readable( (obj->data.fs->free ? obj->data.fs->free :
? obj->data.fs->free : obj->data.fs->avail), p, 255);
}
}
+#ifdef X11
OBJ(fs_bar_free) {
if (obj->data.fs != NULL) {
if (obj->data.fs->size == 0) {
}
}
}
+#endif
OBJ(fs_used_perc) {
if (obj->data.fs != NULL) {
int val = 0;
OBJ(tab) {
new_tab(p, obj->data.pair.a, obj->data.pair.b);
}
+#ifdef X11
OBJ(hr) {
new_hr(p, obj->data.i);
}
+#endif
OBJ(nameserver) {
if (cur->nameserver_info.nscount > obj->data.i)
snprintf(p, p_max_size, "%s",
if (cur->memmax)
percent_print(p, p_max_size, cur->mem * 100 / cur->memmax);
}
+#ifdef X11
OBJ(memgauge){
new_gauge(p, obj->data.pair.a, obj->data.pair.b,
cur->memmax ? (cur->mem * 255) / (cur->memmax) : 0);
cur->memmax ? (cur->mem * 100.0) / (cur->memmax) : 0.0,
100, 1, obj->showaslog);
}
-
+#endif
/* mixer stuff */
OBJ(mixer) {
percent_print(p, p_max_size, mixer_get_avg(obj->data.l));
OBJ(mixerr) {
percent_print(p, p_max_size, mixer_get_right(obj->data.l));
}
+#ifdef X11
OBJ(mixerbar) {
new_bar(p, obj->data.mixerbar.w, obj->data.mixerbar.h,
mixer_to_255(obj->data.mixerbar.l,mixer_get_avg(obj->data.mixerbar.l)));
new_bar(p, obj->data.mixerbar.w, obj->data.mixerbar.h,
mixer_to_255(obj->data.mixerbar.l,mixer_get_right(obj->data.mixerbar.l)));
}
+#endif
OBJ(if_mixer_mute) {
if (!mixer_is_mute(obj->data.ifblock.i)) {
DO_JUMP;
OBJ(text) {
snprintf(p, p_max_size, "%s", obj->data.s);
}
+#ifdef X11
OBJ(shadecolor) {
new_bg(p, obj->data.l);
}
OBJ(stippled_hr) {
new_stippled_hr(p, obj->data.pair.a, obj->data.pair.b);
}
+#endif
OBJ(swap) {
human_readable(cur->swap * 1024, p, 255);
}
percent_print(p, p_max_size, cur->swap * 100 / cur->swapmax);
}
}
+#ifdef X11
OBJ(swapbar) {
new_bar(p, obj->data.pair.a, obj->data.pair.b,
cur->swapmax ? (cur->swap * 255) / (cur->swapmax) : 0);
}
+#endif
OBJ(sysname) {
snprintf(p, p_max_size, "%s", cur->uname_s.sysname);
}
spaced_print(p, p_max_size, "%.1f", 8,
obj->data.net->trans_speed / 1024.0);
}
+#ifdef X11
OBJ(upspeedgraph) {
new_graph(p, obj->a, obj->b, obj->c, obj->d,
obj->data.net->trans_speed / 1024.0, obj->e, 1, obj->showaslog);
}
+#endif
OBJ(uptime_short) {
format_seconds_short(p, p_max_size, (int) cur->uptime);
}
OBJ(mpd_percent) {
percent_print(p, p_max_size, (int)(mpd_get_info()->progress * 100));
}
+#ifdef X11
OBJ(mpd_bar) {
new_bar(p, obj->data.pair.a, obj->data.pair.b,
(int) (mpd_get_info()->progress * 255.0f));
}
+#endif
OBJ(mpd_smart) {
struct mpd_s *mpd = mpd_get_info();
int len = obj->data.i;
OBJ(entropy_poolsize) {
snprintf(p, p_max_size, "%d", cur->entropy.poolsize);
}
+#ifdef X11
OBJ(entropy_bar) {
double entropy_perc;
(double) cur->entropy.poolsize;
new_bar(p, obj->a, obj->b, (int) (entropy_perc * 255.0f));
}
+#endif
#ifdef IBM
OBJ(smapi) {
char *s;
return &specials[special_count++];
}
+#ifdef X11
void new_gauge(char *buf, int w, int h, int usage)
{
-#ifdef X11
struct special_t *s = 0;
if ((output_methods & TO_X) == 0)
return;
s->arg = (usage > 255) ? 255 : ((usage < 0) ? 0 : usage);
s->width = w;
s->height = h;
-#endif
}
void new_bar(char *buf, int w, int h, int usage)
{
-#ifdef X11
struct special_t *s = 0;
if ((output_methods & TO_X) == 0)
s->arg = (usage > 255) ? 255 : ((usage < 0) ? 0 : usage);
s->width = w;
s->height = h;
-#endif
}
void new_font(char *buf, char *args)
{
-#ifdef X11
if ((output_methods & TO_X) == 0)
return;
selected_font = s->font_added = 0;
selected_font = tmp;
}
-#else
- (void)buf;
- (void)args;
- return;
-#endif
}
static void graph_append(struct special_t *graph, double f, char showaslog)
void new_graph(char *buf, int w, int h, unsigned int first_colour,
unsigned int second_colour, double i, int scale, int append, char showaslog)
{
-#ifdef X11
struct special_t *s = 0;
if ((output_methods & TO_X) == 0)
if (append) {
graph_append(s, i, showaslog);
}
-#endif
}
void new_hr(char *buf, int a)
{
-#ifdef X11
if ((output_methods & TO_X) == 0)
return;
new_special(buf, HORIZONTAL_LINE)->height = a;
-#endif
}
void new_stippled_hr(char *buf, int a, int b)
{
-#ifdef X11
struct special_t *s = 0;
if ((output_methods & TO_X) == 0)
s->height = b;
s->arg = a;
-#endif
}
void new_fg(char *buf, long c)
{
-#ifdef X11
if ((output_methods & TO_X) == 0)
return;
new_special(buf, FG)->arg = c;
-#endif
}
void new_bg(char *buf, long c)
{
-#ifdef X11
if ((output_methods & TO_X) == 0)
return;
new_special(buf, BG)->arg = c;
-#endif
}
+#endif
void new_outline(char *buf, long c)
{