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.

69 lines
1.8 KiB

4 years ago
  1. From 73f9b8a4563ff89953459feae5bdbda8bdff94e7 Mon Sep 17 00:00:00 2001
  2. From: Christopher Drelich <cd@cdrakka.com>
  3. Date: Thu, 24 May 2018 20:40:58 -0400
  4. Subject: [PATCH] Moved layout symbol to left-hand side.
  5. ---
  6. dwm.c | 31 +++++++++++++++++--------------
  7. 1 file changed, 17 insertions(+), 14 deletions(-)
  8. diff --git a/dwm.c b/dwm.c
  9. index bb95e26..9a57082 100644
  10. --- a/dwm.c
  11. +++ b/dwm.c
  12. @@ -431,18 +431,21 @@ buttonpress(XEvent *e)
  13. }
  14. if (ev->window == selmon->barwin) {
  15. i = x = 0;
  16. - do
  17. - x += TEXTW(tags[i]);
  18. - while (ev->x >= x && ++i < LENGTH(tags));
  19. - if (i < LENGTH(tags)) {
  20. - click = ClkTagBar;
  21. - arg.ui = 1 << i;
  22. - } else if (ev->x < x + blw)
  23. + x += blw;
  24. + if (ev->x < x) {
  25. click = ClkLtSymbol;
  26. - else if (ev->x > selmon->ww - TEXTW(stext))
  27. - click = ClkStatusText;
  28. - else
  29. - click = ClkWinTitle;
  30. + } else {
  31. + do
  32. + x += TEXTW(tags[i]);
  33. + while (ev->x >= x && ++i < LENGTH(tags));
  34. + if (i < LENGTH(tags)) {
  35. + click = ClkTagBar;
  36. + arg.ui = 1 << i;
  37. + } else if (ev->x > selmon->ww - TEXTW(stext))
  38. + click = ClkStatusText;
  39. + else
  40. + click = ClkWinTitle;
  41. + }
  42. } else if ((c = wintoclient(ev->window))) {
  43. focus(c);
  44. restack(selmon);
  45. @@ -714,6 +717,9 @@ drawbar(Monitor *m)
  46. urg |= c->tags;
  47. }
  48. x = 0;
  49. + w = blw = TEXTW(m->ltsymbol);
  50. + drw_setscheme(drw, scheme[SchemeNorm]);
  51. + x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
  52. for (i = 0; i < LENGTH(tags); i++) {
  53. w = TEXTW(tags[i]);
  54. drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
  55. @@ -724,9 +730,6 @@ drawbar(Monitor *m)
  56. urg & 1 << i);
  57. x += w;
  58. }
  59. - w = blw = TEXTW(m->ltsymbol);
  60. - drw_setscheme(drw, scheme[SchemeNorm]);
  61. - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
  62. if ((w = m->ww - sw - x) > bh) {
  63. if (m->sel) {
  64. --
  65. 2.7.4