Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
738 B

  1. int
  2. click_statuscmd(Bar *bar, Arg *arg, BarArg *a)
  3. {
  4. return click_statuscmd_text(arg, a->x, rawstext);
  5. }
  6. int
  7. click_statuscmd_text(Arg *arg, int rel_x, char *text)
  8. {
  9. int i = -1;
  10. int x = 0;
  11. char ch;
  12. dwmblockssig = -1;
  13. while (text[++i]) {
  14. if ((unsigned char)text[i] < ' ') {
  15. ch = text[i];
  16. text[i] = '\0';
  17. x += status2dtextlength(text);
  18. text[i] = ch;
  19. text += i+1;
  20. i = -1;
  21. if (x >= rel_x && dwmblockssig != -1)
  22. break;
  23. dwmblockssig = ch;
  24. }
  25. }
  26. if (dwmblockssig == -1)
  27. dwmblockssig = 0;
  28. return ClkStatusText;
  29. }
  30. void
  31. copyvalidchars(char *text, char *rawtext)
  32. {
  33. int i = -1, j = 0;
  34. while (rawtext[++i]) {
  35. if ((unsigned char)rawtext[i] >= ' ') {
  36. text[j++] = rawtext[i];
  37. }
  38. }
  39. text[j] = '\0';
  40. }