My slstatus configuration
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

25 satır
380 B

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