AC_DEFINE(XMMS2, 1, [Define if you want XMMS2 support])
fi
+dnl
+dnl RSS
+dnl
+
+AC_ARG_ENABLE([rss],
+ AC_HELP_STRING([--enable-rss], [enable if you want rss support (requires libmrss) @<:@default=no@:>@]),
+ [want_rss="$enableval"], [want_rss=no])
+#
+AM_CONDITIONAL(BUILD_RSS, test x$want_rss = xyes)
+if test x$want_rss = xyes; then
+ WANT_GLIB=yes
+ PKG_CHECK_MODULES([MRSS], [mrss])
+ CFLAGS="$CFLAGS $MRSS_CFLAGS"
+ LIBS="$LIBS $MRSS_LIBS"
+ AC_DEFINE(RSS, 1, [Define if you want rss support])
+fi
dnl
dnl IMLIB2
if test "x$PORT_MONITORS_MISSING" = xyes; then
AC_MSG_ERROR([missing a needed network header for port monitoring])
fi
- PKG_CHECK_MODULES([GLIB], [glib-2.0])
- CFLAGS="$CFLAGS $GLIB_CFLAGS"
- LIBS="$LIBS $GLIB_LIBS"
- AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
+ WANT_GLIB=yes
+ AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
fi
fi
fi
fi
+dnl
+dnl GLIB
+dnl
+
+if test x$WANT_GLIB = xyes; then
+ PKG_CHECK_MODULES([GLIB], [glib-2.0])
+ CFLAGS="$CFLAGS $GLIB_CFLAGS"
+ LIBS="$LIBS $GLIB_LIBS"
+fi
dnl
dnl KVM
* general:
hddtemp: $want_hddtemp
portmon: $want_portmon
+ RSS: $want_rss
EOF
hddtemp = hddtemp.c
endif
+if BUILD_RSS
+rss = rss.c
+endif
+
conky_SOURCES = \
$(audacious) \
$(bmpx) \
$(netbsd) \
$(openbsd) \
$(port_monitors) \
+ $(rss) \
$(solaris) \
timed_thread.c \
timed_thread.h \
#ifdef TCP_PORT_MONITOR
" * portmon\n"
#endif /* TCP_PORT_MONITOR */
+#ifdef RSS
+ " * rss\n"
+#endif
"\n");
exit(0);
OBJ_bmpx_uri,
OBJ_bmpx_bitrate,
#endif
+#ifdef RSS
+ OBJ_rss,
+#endif
#ifdef TCP_PORT_MONITOR
OBJ_tcp_portmon,
#endif
char *dev;
} hddtemp; /* 2 */
#endif
+#ifdef RSS
+ struct {
+ char *uri;
+ int count;
+ } rss;
+#endif
} data;
};
case OBJ_bmpx_uri:
case OBJ_bmpx_bitrate:
#endif
+#ifdef RSS
+ case OBJ_rss:
+ free(objs[i].data.rss.uri);
+#endif
case OBJ_pre_exec:
case OBJ_battery:
free(objs[i].data.s);
memset(&(info.bmpx), 0, sizeof(struct bmpx_s));
END
#endif
+#ifdef RSS
+ OBJ(rss, 0)
+ if (arg) {
+ int argc, count;
+ char *uri = (char *)malloc(64 * sizeof(char *));
+
+ argc = sscanf(arg, "%63s %d", uri, &count);
+ printf("argc: %d, uri: %s, count: %d\n", argc, uri, count);
+ obj->data.rss.uri = uri;
+ obj->data.rss.count = count;
+ } else
+ CRIT_ERR("rss: needs arguments");
+
+ END
+#endif
#ifdef HDDTEMP
OBJ(hddtemp, 0)
if (!arg || scan_hddtemp(arg, &obj->data.hddtemp.dev,
OBJ(hr) {
new_hr(p, obj->data.i);
}
+#ifdef RSS
+ OBJ(rss) {
+ GList *walk = NULL;
+ GList *list = NULL;
+ char *titles = malloc(1024*sizeof(char *));
+
+ memset(titles, 0, sizeof(titles));
+ list = get_rss_info(obj->data.rss.uri, obj->data.rss.count);
+
+ for (walk = g_list_first(list); walk != NULL; walk = g_list_next(walk)) {
+ snprintf(titles, 1023, "%s%s\n", titles, (char *)walk->data);
+ free(walk->data);
+ }
+
+ /* we don't need last \n */
+ titles[strlen(titles)-2] = '\0';
+
+ snprintf(p, p_max_size, "%s", titles);
+
+ free(titles);
+ g_list_free(walk);
+ g_list_free(list);
+ }
+#endif
#ifdef HDDTEMP
OBJ(hddtemp) {
char *temp;
#include <xmmsclient/xmmsclient.h>
#endif
+#ifdef RSS
+#include <glib.h>
+#endif
+
#include "mboxscan.h"
#include "timed_thread.h"
INFO_XMMS2 = 22,
#endif
INFO_ENTROPY = 23,
+#ifdef RSS
+ INFO_RSS = 24,
+#endif
};
char *get_hddtemp_info(char *dev, char *addr, int port, char *unit);
#endif /* HDDTEMP */
+/* in rss.c */
+#ifdef RSS
+GList* get_rss_info(char *uri, int count);
+#endif /* RSS */
+
/* in linux.c */
#endif