My slstatus configuration
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
257 B

  1. #include <err.h>
  2. #include <stdlib.h>
  3. #include "util.h"
  4. const char *
  5. load_avg(const char *fmt)
  6. {
  7. double avgs[3];
  8. if (getloadavg(avgs, 3) < 0) {
  9. warnx("Failed to get the load avg");
  10. return NULL;
  11. }
  12. return bprintf(fmt, avgs[0], avgs[1], avgs[2]);
  13. }