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.

62 lines
2.3 KiB

4 years ago
  1. From 75d5edbe16ee2fc060ff8b05eea17791d6334a59 Mon Sep 17 00:00:00 2001
  2. From: Christopher Drelich <cd@cdrakka.com>
  3. Date: Thu, 24 May 2018 23:24:12 -0400
  4. Subject: [PATCH] Replaces magic numbers in statusbar with configurable
  5. variables.
  6. horizpadbar for horizontal statusbar padding
  7. vertpadbar for vertical statusbar padding
  8. StatusText now has both left and right padding,
  9. as well as the vertical padding that all of the statusbar shares.
  10. Other than the addition of left padding to StatusText, appearance
  11. of the statusbar is identical to pre-patch when using the defaults
  12. in config.def.h
  13. ---
  14. config.def.h | 2 ++
  15. dwm.c | 8 ++++----
  16. 2 files changed, 6 insertions(+), 4 deletions(-)
  17. diff --git a/config.def.h b/config.def.h
  18. index a9ac303..5819399 100644
  19. --- a/config.def.h
  20. +++ b/config.def.h
  21. @@ -5,6 +5,8 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
  22. static const unsigned int snap = 32; /* snap pixel */
  23. static const int showbar = 1; /* 0 means no bar */
  24. static const int topbar = 1; /* 0 means bottom bar */
  25. +static const int horizpadbar = 2; /* horizontal padding for statusbar */
  26. +static const int vertpadbar = 0; /* vertical padding for statusbar */
  27. static const char *fonts[] = { "monospace:size=10" };
  28. static const char dmenufont[] = "monospace:size=10";
  29. static const char col_gray1[] = "#222222";
  30. diff --git a/dwm.c b/dwm.c
  31. index bb95e26..7b9ed42 100644
  32. --- a/dwm.c
  33. +++ b/dwm.c
  34. @@ -704,8 +704,8 @@ drawbar(Monitor *m)
  35. /* draw status first so it can be overdrawn by tags later */
  36. if (m == selmon) { /* status is only drawn on selected monitor */
  37. drw_setscheme(drw, scheme[SchemeNorm]);
  38. - sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
  39. - drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0);
  40. + sw = TEXTW(stext);
  41. + drw_text(drw, m->ww - sw, 0, sw, bh, lrpad / 2, stext, 0);
  42. }
  43. for (c = m->clients; c; c = c->next) {
  44. @@ -1544,8 +1544,8 @@ setup(void)
  45. drw = drw_create(dpy, screen, root, sw, sh);
  46. if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
  47. die("no fonts could be loaded.");
  48. - lrpad = drw->fonts->h;
  49. - bh = drw->fonts->h + 2;
  50. + lrpad = drw->fonts->h + horizpadbar;
  51. + bh = drw->fonts->h + vertpadbar;
  52. updategeom();
  53. /* init atoms */
  54. utf8string = XInternAtom(dpy, "UTF8_STRING", False);
  55. --
  56. 2.7.4