mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-27 20:44:56 +00:00
Fix compiling without X11
This commit is contained in:
parent
b11f2466af
commit
25e46ca341
12
src/conky.c
12
src/conky.c
@ -2557,6 +2557,7 @@ static struct text_object *construct_text_object(const char *s,
|
|||||||
obj->data.s = strndup(arg, text_buffer_size);
|
obj->data.s = strndup(arg, text_buffer_size);
|
||||||
else
|
else
|
||||||
ERR("smapi_bat_power needs an argument");
|
ERR("smapi_bat_power needs an argument");
|
||||||
|
#ifdef X11
|
||||||
END OBJ(smapi_bat_bar, 0)
|
END OBJ(smapi_bat_bar, 0)
|
||||||
SIZE_DEFAULTS(bar);
|
SIZE_DEFAULTS(bar);
|
||||||
if(arg) {
|
if(arg) {
|
||||||
@ -2570,6 +2571,7 @@ static struct text_object *construct_text_object(const char *s,
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
ERR("smapi_bat_bar needs an argument");
|
ERR("smapi_bat_bar needs an argument");
|
||||||
|
#endif /* X11 */
|
||||||
#endif /* IBM */
|
#endif /* IBM */
|
||||||
#ifdef MPD
|
#ifdef MPD
|
||||||
#define mpd_set_maxlen(name) \
|
#define mpd_set_maxlen(name) \
|
||||||
@ -2647,9 +2649,11 @@ static struct text_object *construct_text_object(const char *s,
|
|||||||
END OBJ(xmms2_size, INFO_XMMS2)
|
END OBJ(xmms2_size, INFO_XMMS2)
|
||||||
END OBJ(xmms2_status, INFO_XMMS2)
|
END OBJ(xmms2_status, INFO_XMMS2)
|
||||||
END OBJ(xmms2_percent, INFO_XMMS2)
|
END OBJ(xmms2_percent, INFO_XMMS2)
|
||||||
|
#ifdef X11
|
||||||
END OBJ(xmms2_bar, INFO_XMMS2)
|
END OBJ(xmms2_bar, INFO_XMMS2)
|
||||||
SIZE_DEFAULTS(bar);
|
SIZE_DEFAULTS(bar);
|
||||||
scan_bar(arg, &obj->data.pair.a, &obj->data.pair.b);
|
scan_bar(arg, &obj->data.pair.a, &obj->data.pair.b);
|
||||||
|
#endif /* X11 */
|
||||||
END OBJ(xmms2_smart, INFO_XMMS2)
|
END OBJ(xmms2_smart, INFO_XMMS2)
|
||||||
END OBJ(xmms2_playlist, INFO_XMMS2)
|
END OBJ(xmms2_playlist, INFO_XMMS2)
|
||||||
END OBJ(xmms2_timesplayed, INFO_XMMS2)
|
END OBJ(xmms2_timesplayed, INFO_XMMS2)
|
||||||
@ -2677,9 +2681,11 @@ static struct text_object *construct_text_object(const char *s,
|
|||||||
END OBJ(audacious_playlist_length, INFO_AUDACIOUS)
|
END OBJ(audacious_playlist_length, INFO_AUDACIOUS)
|
||||||
END OBJ(audacious_playlist_position, INFO_AUDACIOUS)
|
END OBJ(audacious_playlist_position, INFO_AUDACIOUS)
|
||||||
END OBJ(audacious_main_volume, INFO_AUDACIOUS)
|
END OBJ(audacious_main_volume, INFO_AUDACIOUS)
|
||||||
|
#ifdef X11
|
||||||
END OBJ(audacious_bar, INFO_AUDACIOUS)
|
END OBJ(audacious_bar, INFO_AUDACIOUS)
|
||||||
SIZE_DEFAULTS(bar);
|
SIZE_DEFAULTS(bar);
|
||||||
scan_bar(arg, &obj->a, &obj->b);
|
scan_bar(arg, &obj->a, &obj->b);
|
||||||
|
#endif /* X11 */
|
||||||
#endif
|
#endif
|
||||||
#ifdef BMPX
|
#ifdef BMPX
|
||||||
END OBJ(bmpx_title, INFO_BMPX)
|
END OBJ(bmpx_title, INFO_BMPX)
|
||||||
@ -5232,10 +5238,12 @@ static void generate_text_internal(char *p, int p_max_size,
|
|||||||
OBJ(xmms2_percent) {
|
OBJ(xmms2_percent) {
|
||||||
snprintf(p, p_max_size, "%2.0f", cur->xmms2.progress * 100);
|
snprintf(p, p_max_size, "%2.0f", cur->xmms2.progress * 100);
|
||||||
}
|
}
|
||||||
|
#ifdef X11
|
||||||
OBJ(xmms2_bar) {
|
OBJ(xmms2_bar) {
|
||||||
new_bar(p, obj->data.pair.a, obj->data.pair.b,
|
new_bar(p, obj->data.pair.a, obj->data.pair.b,
|
||||||
(int) (cur->xmms2.progress * 255.0f));
|
(int) (cur->xmms2.progress * 255.0f));
|
||||||
}
|
}
|
||||||
|
#endif /* X11 */
|
||||||
OBJ(xmms2_playlist) {
|
OBJ(xmms2_playlist) {
|
||||||
snprintf(p, p_max_size, "%s", cur->xmms2.playlist);
|
snprintf(p, p_max_size, "%s", cur->xmms2.playlist);
|
||||||
}
|
}
|
||||||
@ -5311,6 +5319,7 @@ static void generate_text_internal(char *p, int p_max_size,
|
|||||||
snprintf(p, p_max_size, "%s",
|
snprintf(p, p_max_size, "%s",
|
||||||
cur->audacious.items[AUDACIOUS_MAIN_VOLUME]);
|
cur->audacious.items[AUDACIOUS_MAIN_VOLUME]);
|
||||||
}
|
}
|
||||||
|
#ifdef X11
|
||||||
OBJ(audacious_bar) {
|
OBJ(audacious_bar) {
|
||||||
double progress;
|
double progress;
|
||||||
|
|
||||||
@ -5319,6 +5328,7 @@ static void generate_text_internal(char *p, int p_max_size,
|
|||||||
atof(cur->audacious.items[AUDACIOUS_LENGTH_SECONDS]);
|
atof(cur->audacious.items[AUDACIOUS_LENGTH_SECONDS]);
|
||||||
new_bar(p, obj->a, obj->b, (int) (progress * 255.0f));
|
new_bar(p, obj->a, obj->b, (int) (progress * 255.0f));
|
||||||
}
|
}
|
||||||
|
#endif /* X11 */
|
||||||
#endif /* AUDACIOUS */
|
#endif /* AUDACIOUS */
|
||||||
|
|
||||||
#ifdef BMPX
|
#ifdef BMPX
|
||||||
@ -5538,6 +5548,7 @@ static void generate_text_internal(char *p, int p_max_size,
|
|||||||
} else
|
} else
|
||||||
ERR("argument to smapi_bat_power must be an integer");
|
ERR("argument to smapi_bat_power must be an integer");
|
||||||
}
|
}
|
||||||
|
#ifdef X11
|
||||||
OBJ(smapi_bat_bar) {
|
OBJ(smapi_bat_bar) {
|
||||||
if(obj->data.i >= 0 && smapi_bat_installed(obj->data.i))
|
if(obj->data.i >= 0 && smapi_bat_installed(obj->data.i))
|
||||||
new_bar(p, obj->a, obj->b, (int)
|
new_bar(p, obj->a, obj->b, (int)
|
||||||
@ -5545,6 +5556,7 @@ static void generate_text_internal(char *p, int p_max_size,
|
|||||||
else
|
else
|
||||||
new_bar(p, obj->a, obj->b, 0);
|
new_bar(p, obj->a, obj->b, 0);
|
||||||
}
|
}
|
||||||
|
#endif /* X11 */
|
||||||
#endif /* IBM */
|
#endif /* IBM */
|
||||||
OBJ(scroll) {
|
OBJ(scroll) {
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
|
Loading…
Reference in New Issue
Block a user