87a188b59e0c1ae8af60258e12e3d4d185ca4eaf
* SGK version of dwmstatus by 20h.
len
= vsnprintf(NULL
, 0, fmt
, fmtargs
);
vsnprintf(ret
, len
, fmt
, fmtargs
);
mktimes(char *fmt
, char *tzname
)
if (!strftime(buf
, sizeof(buf
)-1, fmt
, timtm
)) {
fprintf(stderr
, "strftime == 0\n");
return smprintf("%s", buf
);
XStoreName(dpy
, DefaultRootWindow(dpy
), str
);
if (getloadavg(avgs
, 3) < 0)
return smprintf("%.2f", avgs
[0]);
char *load
, *datetime
, *status
;
if (!(dpy
= XOpenDisplay(NULL
))) {
fprintf(stderr
, "dwmstatus: cannot open display.\n");
datetime
= mktimes("%a %d %b %Y ][ %H:%M", "America/Los_Angeles");
status
= smprintf("[ %s ][ %s ]", load
, datetime
);