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

19 lines
297 B

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