status

statusbar program for dwm
git clone anongit@rnpnr.xyz:status.git
Log | Files | Refs | Feed | README | LICENSE

date.c (277B)


      1 /* See LICENSE for license details. */
      2 static BLOCK_UPDATE_FN(date_update)
      3 {
      4 	time_t t = time(NULL);
      5 	strftime(buffer, sizeof(buffer), b->arg, localtime(&t));
      6 	b->len = snprintf(b->data, sizeof(b->data), b->fmt, buffer);
      7 }
      8 
      9 static BLOCK_INIT_FN(date_init)
     10 {
     11 	date_update(b);
     12 }