dwm-tilegap-6.2.diff - sites - public wiki contents of suckless.org | |
git clone git://git.suckless.org/sites | |
Log | |
Files | |
Refs | |
--- | |
dwm-tilegap-6.2.diff (2538B) | |
--- | |
1 From dfea960240ed45a660abc1acba2041318127761f Mon Sep 17 00:00:00 2001 | |
2 From: astier <[email protected]> | |
3 Date: Thu, 21 Feb 2019 09:38:38 +0100 | |
4 Subject: [PATCH] Add window-gaps for the tile-layout | |
5 | |
6 Adds gaps between windows in the tile-layout. The proposed advantage to … | |
7 other patches which try to accomplish the same goal is that the gap-size… | |
8 master and stack, window and window, and window and screen-edge is the | |
9 same. The gap-size can be configured in the config.h with the | |
10 gappx-variable. | |
11 --- | |
12 config.def.h | 1 + | |
13 dwm.c | 23 +++++++++++++---------- | |
14 2 files changed, 14 insertions(+), 10 deletions(-) | |
15 | |
16 diff --git a/config.def.h b/config.def.h | |
17 index 1c0b587..2ca9e56 100644 | |
18 --- a/config.def.h | |
19 +++ b/config.def.h | |
20 @@ -2,6 +2,7 @@ | |
21 | |
22 /* appearance */ | |
23 static const unsigned int borderpx = 1; /* border pixel of wind… | |
24 +static const unsigned int gappx = 18; /* gap pixel between wi… | |
25 static const unsigned int snap = 32; /* snap pixel */ | |
26 static const int showbar = 1; /* 0 means no bar */ | |
27 static const int topbar = 1; /* 0 means bottom bar */ | |
28 diff --git a/dwm.c b/dwm.c | |
29 index 4465af1..c556a2d 100644 | |
30 --- a/dwm.c | |
31 +++ b/dwm.c | |
32 @@ -1673,26 +1673,29 @@ tagmon(const Arg *arg) | |
33 void | |
34 tile(Monitor *m) | |
35 { | |
36 - unsigned int i, n, h, mw, my, ty; | |
37 + unsigned int i, n, h, mw, my, ty, ns; | |
38 Client *c; | |
39 | |
40 for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next… | |
41 if (n == 0) | |
42 return; | |
43 | |
44 - if (n > m->nmaster) | |
45 + if (n > m->nmaster) { | |
46 mw = m->nmaster ? m->ww * m->mfact : 0; | |
47 - else | |
48 + ns = m->nmaster > 0 ? 2 : 1; | |
49 + } else { | |
50 mw = m->ww; | |
51 - for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttil… | |
52 + ns = 1; | |
53 + } | |
54 + for(i = 0, my = ty = gappx, c = nexttiled(m->clients); c; c = n… | |
55 if (i < m->nmaster) { | |
56 - h = (m->wh - my) / (MIN(n, m->nmaster) - i); | |
57 - resize(c, m->wx, m->wy + my, mw - (2*c->bw), h … | |
58 - my += HEIGHT(c); | |
59 + h = (m->wh - my) / (MIN(n, m->nmaster) - i) - g… | |
60 + resize(c, m->wx + gappx, m->wy + my, mw - (2*c-… | |
61 + my += HEIGHT(c) + gappx; | |
62 } else { | |
63 - h = (m->wh - ty) / (n - i); | |
64 - resize(c, m->wx + mw, m->wy + ty, m->ww - mw - … | |
65 - ty += HEIGHT(c); | |
66 + h = (m->wh - ty) / (n - i) - gappx; | |
67 + resize(c, m->wx + mw + gappx/ns, m->wy + ty, m-… | |
68 + ty += HEIGHT(c) + gappx; | |
69 } | |
70 } | |
71 | |
72 -- | |
73 2.20.1 |