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.
 
 
 
 

31 righe
482 B

  1. /* See LICENSE file for copyright and license details. */
  2. #include <stdio.h>
  3. #include <X11/Xlib.h>
  4. #include "../util.h"
  5. const char *
  6. keyboard_indicators(void)
  7. {
  8. Display *dpy;
  9. XKeyboardState state;
  10. if (!(dpy = XOpenDisplay(NULL))) {
  11. fprintf(stderr, "Cannot open display\n");
  12. return NULL;
  13. }
  14. XGetKeyboardControl(dpy, &state);
  15. XCloseDisplay(dpy);
  16. switch (state.led_mask) {
  17. case 1:
  18. return "c";
  19. case 2:
  20. return "n";
  21. case 3:
  22. return "cn";
  23. default:
  24. return "";
  25. }
  26. }