--- a/config.def.h Sat Mar 16 00:03:51 2013 +0400
+++ b/config.def.h Mon Oct 20 22:59:08 2014 +0400
@@ -1,8 +1,7 @@
static DPokeSource sources[] = {
- { DPOKE_PROGRAM, "./shi_date.sh" },
- { DPOKE_PROGRAM, "./shi_buftest" },
- { DPOKE_PROGRAM, "./shi_dietest" },
- { DPOKE_PROGRAM, "/bin/true" },
+ { DPOKE_PROGRAM, "./status-mem/status-mem" },
+ { DPOKE_PROGRAM, "./status-loadavg/status-loadavg" },
+ { DPOKE_PROGRAM, "./status-time/status-time" },
};
#define FAILURE_MSG "FAILURE"
@@ -10,6 +9,40 @@
#define MINTIME 1.0
//#define DEBUG
+#include <X11/Xlib.h>
+
+Display *dpy;
+Window rootwin;
+int scr;
+
+void display(char* v[], size_t vc) {
+ char *new_title = smprintf("%s | %s | %s",v[0],v[1],v[2]);
+ XStoreName(dpy, rootwin, new_title);
+ //printf("set: %s\n", new_title);
+ XSync(dpy, False);
+ free(new_title);
+}
+
+void setup() {
+ if(!(dpy=XOpenDisplay(NULL))) {
+ fprintf(stderr, "ERROR: could not open display\n");
+ exit(21);
+ }
+ scr = DefaultScreen(dpy);
+ rootwin = RootWindow(dpy, scr);
+}
+
+void cleanup(int exitcode) {
+ XCloseDisplay(dpy);
+}
+
+#if 0
+// no-X11 variant:
void display() {
printf("%s | <%s> | %s | %s\n",v[0],v[1],v[2],v[3]);
}
+void setup() {
+}
+void cleanup(int exitcode) {
+}
+#endif