My slstatus configuration
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

25 wiersze
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. }