My build of dwm
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 

78 líneas
2.3 KiB

  1. Author: Chris Noxz <chris@noxz.tech>
  2. diff -upN dwm-6.1/config.def.h dwm-nrowgrid-6.1/config.def.h
  3. --- dwm-6.1/config.def.h 2015-11-08 23:11:48.000000000 +0100
  4. +++ dwm-nrowgrid-6.1/config.def.h 2018-10-01 10:44:05.631382842 +0200
  5. @@ -34,11 +34,15 @@ static const float mfact = 0.55; /*
  6. static const int nmaster = 1; /* number of clients in master area */
  7. static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
  8. +#define FORCE_VSPLIT 1
  9. +#include "nrowgrid.c"
  10. +
  11. static const Layout layouts[] = {
  12. /* symbol arrange function */
  13. { "[]=", tile }, /* first entry is default */
  14. { "><>", NULL }, /* no layout function means floating behavior */
  15. { "[M]", monocle },
  16. + { "###", nrowgrid },
  17. };
  18. /* key definitions */
  19. diff -upN dwm-6.1/nrowgrid.c dwm-nrowgrid-6.1/nrowgrid.c
  20. --- dwm-6.1/nrowgrid.c 1970-01-01 01:00:00.000000000 +0100
  21. +++ dwm-nrowgrid-6.1/nrowgrid.c 2018-10-01 10:44:27.741263063 +0200
  22. @@ -0,0 +1,52 @@
  23. +void
  24. +nrowgrid(Monitor *m)
  25. +{
  26. + unsigned int n = 0, i = 0, ri = 0, ci = 0; /* counters */
  27. + unsigned int cx, cy, cw, ch; /* client geometry */
  28. + unsigned int uw = 0, uh = 0, uc = 0; /* utilization trackers */
  29. + unsigned int cols, rows = m->nmaster + 1;
  30. + Client *c;
  31. +
  32. + /* count clients */
  33. + for (c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
  34. +
  35. + /* nothing to do here */
  36. + if (n == 0)
  37. + return;
  38. +
  39. + /* force 2 clients to always split vertically */
  40. + if (FORCE_VSPLIT && n == 2)
  41. + rows = 1;
  42. +
  43. + /* never allow empty rows */
  44. + if (n < rows)
  45. + rows = n;
  46. +
  47. + /* define first row */
  48. + cols = n / rows;
  49. + uc = cols;
  50. + cy = m->wy;
  51. + ch = m->wh / rows;
  52. + uh = ch;
  53. +
  54. + for (c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, ci++) {
  55. + if (ci == cols) {
  56. + uw = 0;
  57. + ci = 0;
  58. + ri++;
  59. +
  60. + /* next row */
  61. + cols = (n - uc) / (rows - ri);
  62. + uc += cols;
  63. + cy = m->wy + uh;
  64. + ch = (m->wh - uh) / (rows - ri);
  65. + uh += ch;
  66. + }
  67. +
  68. + cx = m->wx + uw;
  69. + cw = (m->ww - uw) / (cols - ci);
  70. + uw += cw;
  71. +
  72. + resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw, 0);
  73. + }
  74. +}