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.
 
 
 
 

18 regels
236 B

  1. #include <sys/sysinfo.h>
  2. #include "util.h"
  3. const char *
  4. uptime(void)
  5. {
  6. struct sysinfo info;
  7. int h = 0;
  8. int m = 0;
  9. sysinfo(&info);
  10. h = info.uptime / 3600;
  11. m = (info.uptime - h * 3600 ) / 60;
  12. return bprintf("%dh %dm", h, m);
  13. }