My slstatus configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
348 B

  1. /* See LICENSE file for copyright and license details. */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include "../util.h"
  5. const char *
  6. load_avg(const char *fmt)
  7. {
  8. double avgs[3];
  9. if (getloadavg(avgs, 3) < 0) {
  10. fprintf(stderr, "getloadavg: Could not obtain load average.\n");
  11. return NULL;
  12. }
  13. return bprintf(fmt, avgs[0], avgs[1], avgs[2]);
  14. }