garbeam@5: /* garbeam@5: * (C)opyright MMVI Anselm R. Garbe garbeam@5: * See LICENSE file for license details. garbeam@5: */ garbeam@5: garbeam@5: #include "wm.h" garbeam@5: garbeam@14: static const char *status[] = { garbeam@14: "sh", "-c", "echo -n `date` `uptime | sed 's/.*://; s/,//g'`" garbeam@14: " `acpi | awk '{print $4}' | sed 's/,//'`", 0 \ garbeam@14: }; garbeam@14: garbeam@5: void garbeam@5: draw_bar() garbeam@5: { garbeam@14: static char buf[1024]; garbeam@14: garbeam@14: buf[0] = 0; garbeam@14: pipe_spawn(buf, sizeof(buf), dpy, (char **)status); garbeam@14: garbeam@5: brush.rect = barrect; garbeam@5: brush.rect.x = brush.rect.y = 0; garbeam@14: draw(dpy, &brush, False, buf); garbeam@5: garbeam@5: XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, barrect.width, garbeam@5: barrect.height, 0, 0); garbeam@5: XFlush(dpy); garbeam@5: }