/* #define SIGNAL_BLOCKING */
#undef SIGNAL_BLOCKING
+static void print_version()
+{
+ printf("Conky %s compiled %s for %s\n",
+ VERSION, BUILD_DATE, BUILD_ARCH);
+
+ printf(
+ "\nCompiled in features:\n\n"
+#ifdef X11
+ " X11:\n"
+# ifdef XFT
+ " * xft\n"
+# endif /* XFT */
+# ifdef HAVE_XDAMAGE
+ " * Xdamage extension\n"
+# endif /* HAVE_XDAMAGE */
+# ifdef HAVE_XDBE
+ " * Xdbe extension (double buffer)\n"
+# endif /* HAVE_XDBE */
+#endif /* X11 */
+ "\n Music detection:\n"
+#ifdef XMMS
+ " * xmms\n"
+#endif /* XMMS */
+#ifdef BMP
+ " * bmp\n"
+#endif /* BMP */
+#ifdef AUDACIOUS
+ " * audacious\n"
+#endif /* AUDACIOUS */
+#ifdef INFOPIPE
+ " * infopipe\n"
+#endif /* INFOPIPE */
+#ifdef BMPX
+ " * bmpx\n"
+#endif /* BMPX */
+#ifdef XMMS2
+ " * xmms2\n"
+#endif /* XMMS2 */
+#ifdef MPD
+ " * mpd\n"
+#endif /* MPD */
+ "\n General features:\n"
+#ifdef TCP_PORT_MONITOR
+ " * portmon\n"
+#endif /* TCP_PORT_MONITOR */
+#ifdef MLDONKEY
+ " * mldonkey\n"
+#endif /* MLDONKEY */
+#ifdef HDDTEMP
+ " * hddtemp\n"
+#endif /* HDDTEMP */
+#ifdef SETI
+ " * seti\n"
+#endif /* SETI*/
+ "\n");
+
+ exit(0);
+}
+
#ifdef X11
/*
static void set_font();
-static void print_version()
-{
- printf("Conky %s compiled %s for %s\n",
- VERSION, BUILD_DATE, BUILD_ARCH);
- exit(0);
-}
-
int addfont(const char *data_in)
{
if (font_count > MAX_FONTS) {
static int minimum_width, minimum_height;
static int maximum_width;
-
+#endif /* X11 */
#ifdef HAVE_ICONV
#define CODEPAGE_LENGTH 20
/* UTF-8 */
int utf8_mode = 0;
-#endif /* X11 */
-
/* no buffers in used memory? */
int no_buffers;
if (use_xft) {
XGlyphInfo gi;
if (utf8_mode) {
- XftTextExtentsUtf8(display, fonts[selected_font].xftfont, s, l, &gi);
+ XftTextExtentsUtf8(display, fonts[selected_font].xftfont, (FcChar8 *)s, l, &gi);
} else {
- XftTextExtents8(display, fonts[selected_font].xftfont, s, l, &gi);
+ XftTextExtents8(display, fonts[selected_font].xftfont, (FcChar8 *)s, l, &gi);
}
return gi.xOff;
} else
}
OBJ(freq) {
if (obj->a) {
- obj->a = get_freq(p, p_max_size, "%.0f", 1, obj->data.cpu_index); /* pk */
+ obj->a = get_freq(p, p_max_size, "%.0f", 1, obj->data.cpu_index);
}
}
OBJ(freq_g) {
if (obj->a) {
- obj->a = get_freq(p, p_max_size, "%'.2f", 1000, obj->data.cpu_index); /* pk */
+ obj->a = get_freq(p, p_max_size, "%'.2f", 1000, obj->data.cpu_index);
}
}
#if defined(__linux__)
OBJ(freq_dyn) {
if (use_spacer) {
- get_freq_dynamic(p, 6, "%.0f ", 1 ); /* pk */
+ get_freq_dynamic(p, 6, "%.0f ", 1 );
} else {
- get_freq_dynamic(p, p_max_size, "%.0f", 1 ); /* pk */
+ get_freq_dynamic(p, p_max_size, "%.0f", 1 );
}
}
OBJ(freq_dyn_g) {
if (use_spacer) {
- get_freq_dynamic(p, 6, "%'.2f ", 1000); /* pk */
+ get_freq_dynamic(p, 6, "%'.2f ", 1000);
} else {
- get_freq_dynamic(p, p_max_size, "%'.2f", 1000); /* pk */
+ get_freq_dynamic(p, p_max_size, "%'.2f", 1000);
}
}
OBJ(adt746xcpu) {
- get_adt746x_cpu(p, p_max_size); /* pk */
+ get_adt746x_cpu(p, p_max_size);
}
OBJ(adt746xfan) {
- get_adt746x_fan(p, p_max_size); /* pk */
+ get_adt746x_fan(p, p_max_size);
}
OBJ(acpifan) {
- get_acpi_fan(p, p_max_size); /* pk */
+ get_acpi_fan(p, p_max_size);
}
OBJ(acpiacadapter) {
- get_acpi_ac_adapter(p, p_max_size); /* pk */
+ get_acpi_ac_adapter(p, p_max_size);
}
OBJ(battery) {
get_battery_stuff(p, p_max_size, obj->data.s);
text_width = minimum_width;
text_height = 0;
special_index = 0;
- int first_font_height = last_font_height = font_height();
+ last_font_height = font_height();
for_each_line(text_buffer, text_size_updater);
- text_height -= first_font_height;
text_width += 1;
if (text_height < minimum_height)
text_height = minimum_height;
#endif /* X11 */
info.looped = 0;
- while (total_run_times == 0 || info.looped < total_run_times - 1) {
+ while (total_run_times == 0 || info.looped < total_run_times) {
info.looped++;
#ifdef SIGNAL_BLOCKING
XDamageNotifyEvent *dev = (XDamageNotifyEvent *) &ev;
XFixesSetRegion(display, part, &dev->area, 1);
XFixesUnionRegion(display, region2, region2, part);
- XDamageSubtract(display, damage, region2, None);
- XFixesSetRegion(display, region2, 0, 0);
}
#endif /* HAVE_XDAMAGE */
break;
}
- }
+ }
+#ifdef HAVE_XDAMAGE
+ XDamageSubtract(display, damage, region2, None);
+ XFixesSetRegion(display, region2, 0, 0);
+#endif /* HAVE_XDAMAGE */
/* XDBE doesn't seem to provide a way to clear the back buffer without
* interfering with the front buffer, other than passing XdbeBackground
/* handle command line parameters that don't change configs */
#ifdef X11
- char *s;
- char temp[10];
+ char *s, *temp;
unsigned int x;
if (((s = getenv("LC_ALL")) && *s) || ((s = getenv("LC_CTYPE")) &&
*s) || ((s = getenv("LANG")) && *s)) {
- strcpy(temp, s);
- for(x = 0; x < strlen(s) ; x++) {
+ temp = (char *)malloc((strlen(s) + 1) * sizeof(char));
+ if (temp == NULL) {
+ ERR("malloc failed");
+ }
+ for (x = 0; x < strlen(s); x++) {
temp[x] = tolower(s[x]);
}
if (strstr(temp, "utf-8") || strstr(temp, "utf8")) {
utf8_mode = 1;
}
+
+ free(temp);
}
if (!setlocale(LC_CTYPE, "")) {
ERR("Can't set the specified locale!\nCheck LANG, LC_CTYPE, LC_ALL.");
{
/* signal handler is light as a feather, as it should be.
* we will poll g_signal_pending with each loop of conky
- * and do any signal processing there, NOT here. pkovacs. */
+ * and do any signal processing there, NOT here. */
g_signal_pending=sig;
}