My slstatus configuration
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617
  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. }