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

19 行
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. }