const char *args;
};
-static void setstatus(const char *);
static char *smprintf(const char *, ...);
static char *battery_perc(const char *);
static char *cpu_perc(void);
#include "config.h"
-static void
-setstatus(const char *str)
-{
- /* set WM_NAME via X11 */
- XStoreName(dpy, DefaultRootWindow(dpy), str);
- XSync(dpy, False);
-}
-
static char *
smprintf(const char *fmt, ...)
{
struct arg argument;
dpy = XOpenDisplay(0x0);
- if (!dpy) {
- fprintf(stderr, "Cannot open display!\n");
- exit(1);
- }
for (;;) {
memset(status_string, 0, sizeof(status_string));
free(element);
}
- setstatus(status_string);
+ XStoreName(dpy, DefaultRootWindow(dpy), status_string);
+ XSync(dpy, False);
sleep(UPDATE_INTERVAL -1);
}
* TODO: find out a way to exit successfully
* to prevent memory leaks
*/
-/*
XCloseDisplay(dpy);
return 0;
-*/
}