tload.c - spoon - [fork] customized build of spoon, the dwm status utility
(HTM) git clone git://src.adamsgaard.dk/spoon
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
tload.c (211B)
---
1 #include <stdlib.h>
2 #include <stdio.h>
3
4 int
5 loadread(void *arg, char *buf, size_t len)
6 {
7 double avgs[3];
8
9 if (getloadavg(avgs, 3) < 0)
10 return -1;
11 snprintf(buf, len, "%.2f",
12 avgs[0]);
13 return 0;
14 }