2008/7/11 Donald Chai <[EMAIL PROTECTED]>: >> Any help would be appreciated, and also how could i do the same >> without using threads? > > > This seems to work fine for me... > > --- a/dwm.c Thu Jul 03 17:05:56 2008 +0100 > +++ b/dwm.c Fri Jul 11 00:26:08 2008 -0700 > @@ -1313,11 +1313,28 @@ setmfact(const Arg *arg) { > arrange(); > } > > +#include <time.h> > + > +void > +updatestatus(int signum) { > + time_t t = time(0); > + struct tm *ctm = localtime(&t); > + > + strftime(stext, sizeof(stext), "%T", ctm); > + drawbar(); > + > + signal(SIGALRM, updatestatus); > + alarm(1); > +} > + > void > setup(void) { > uint i; > int w; > XSetWindowAttributes wa; > + > + signal(SIGALRM, updatestatus); > + alarm(1); > > /* init screen */ > screen = DefaultScreen(dpy); > > > Much thanks for the code, my mind was stuck on threads, but that is much simpler. I am on an 8 yeard old T-23, and dwm really makes it rock. Its as if it was designed for the Thinkpad considering that the trackpoint keeps your hands right on the right keys. Using dwm i feel liberated from the "pointer device" :P
-- Dum inter homines sumus, colamus humanitatem.