Configuration of dwm for Mac Computers
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.

46 lines
832 B

  1. /*
  2. * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
  3. * See LICENSE file for license details.
  4. */
  5. #include "dwm.h"
  6. void
  7. barclick(XButtonPressedEvent *e)
  8. {
  9. int x = 0;
  10. Arg a;
  11. for(a.i = 0; a.i < TLast; a.i++) {
  12. x += textw(tags[a.i]) + dc.font.height;
  13. if(e->x < x) {
  14. view(&a);
  15. return;
  16. }
  17. }
  18. }
  19. void
  20. draw_bar()
  21. {
  22. int i;
  23. dc.x = dc.y = 0;
  24. dc.w = bw;
  25. drawtext(NULL, False, False);
  26. dc.w = 0;
  27. for(i = 0; i < TLast; i++) {
  28. dc.x += dc.w;
  29. dc.w = textw(tags[i]) + dc.font.height;
  30. drawtext(tags[i], i == tsel, True);
  31. }
  32. if(sel) {
  33. dc.x += dc.w;
  34. dc.w = textw(sel->name) + dc.font.height;
  35. drawtext(sel->name, True, True);
  36. }
  37. dc.w = textw(stext) + dc.font.height;
  38. dc.x = bx + bw - dc.w;
  39. drawtext(stext, False, False);
  40. XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0);
  41. XFlush(dpy);
  42. }