My slstatus configuration
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

28 rader
471 B

  1. /* See LICENSE file for copyright and license details. */
  2. #if defined(__linux__)
  3. #include <stdint.h>
  4. #include <stdio.h>
  5. #include "../util.h"
  6. const char *
  7. entropy(void)
  8. {
  9. uintmax_t num;
  10. if (pscanf("/proc/sys/kernel/random/entropy_avail", "%ju", &num)
  11. != 1) {
  12. return NULL;
  13. }
  14. return bprintf("%ju", num);
  15. }
  16. #elif defined(__OpenBSD__)
  17. const char *
  18. entropy(void)
  19. {
  20. /* Unicode Character 'INFINITY' (U+221E) */
  21. return "\xe2\x88\x9e";
  22. }
  23. #endif