My slstatus configuration
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

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