dwm-meillo
diff bar.c @ 14:5c078b66347b
added bar event timer
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Tue, 11 Jul 2006 18:15:11 +0200 |
parents | e5018cae273f |
children | 359b6e563b95 |
line diff
1.1 --- a/bar.c Tue Jul 11 16:14:22 2006 +0200 1.2 +++ b/bar.c Tue Jul 11 18:15:11 2006 +0200 1.3 @@ -5,12 +5,22 @@ 1.4 1.5 #include "wm.h" 1.6 1.7 +static const char *status[] = { 1.8 + "sh", "-c", "echo -n `date` `uptime | sed 's/.*://; s/,//g'`" 1.9 + " `acpi | awk '{print $4}' | sed 's/,//'`", 0 \ 1.10 +}; 1.11 + 1.12 void 1.13 draw_bar() 1.14 { 1.15 + static char buf[1024]; 1.16 + 1.17 + buf[0] = 0; 1.18 + pipe_spawn(buf, sizeof(buf), dpy, (char **)status); 1.19 + 1.20 brush.rect = barrect; 1.21 brush.rect.x = brush.rect.y = 0; 1.22 - draw(dpy, &brush, False, 0); 1.23 + draw(dpy, &brush, False, buf); 1.24 1.25 XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, barrect.width, 1.26 barrect.height, 0, 0);