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.

51 lines
1.3 KiB

  1. int
  2. width_wintitle(Bar *bar, BarArg *a)
  3. {
  4. return a->w;
  5. }
  6. int
  7. draw_wintitle(Bar *bar, BarArg *a)
  8. {
  9. #if BAR_TITLE_LEFT_PAD_PATCH && BAR_TITLE_RIGHT_PAD_PATCH
  10. int x = a->x + lrpad / 2, w = a->w - lrpad;
  11. #elif BAR_TITLE_LEFT_PAD_PATCH
  12. int x = a->x + lrpad / 2, w = a->w - lrpad / 2;
  13. #elif BAR_TITLE_RIGHT_PAD_PATCH
  14. int x = a->x, w = a->w - lrpad / 2;
  15. #else
  16. int x = a->x, w = a->w;
  17. #endif // BAR_TITLE_LEFT_PAD_PATCH | BAR_TITLE_RIGHT_PAD_PATCH
  18. Monitor *m = bar->mon;
  19. int pad = lrpad / 2;
  20. if (!m->sel) {
  21. drw_setscheme(drw, scheme[SchemeTitleNorm]);
  22. drw_rect(drw, x, a->y, w, a->h, 1, 1);
  23. return 0;
  24. }
  25. drw_setscheme(drw, scheme[m == selmon ? SchemeTitleSel : SchemeTitleNorm]);
  26. #if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
  27. XSetErrorHandler(xerrordummy);
  28. #endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
  29. #if BAR_CENTEREDWINDOWNAME_PATCH
  30. if (TEXTW(m->sel->name) < w)
  31. pad = (w - TEXTW(m->sel->name) + lrpad) / 2;
  32. #endif // BAR_CENTEREDWINDOWNAME_PATCH
  33. drw_text(drw, x, a->y, w, a->h, pad, m->sel->name, 0, False);
  34. #if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
  35. XSync(dpy, False);
  36. XSetErrorHandler(xerror);
  37. #endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
  38. drawstateindicator(m, m->sel, 1, x, a->y, w, a->h, 0, 0, m->sel->isfixed);
  39. return 1;
  40. }
  41. int
  42. click_wintitle(Bar *bar, Arg *arg, BarArg *a)
  43. {
  44. return ClkWinTitle;
  45. }