diff --git a/PATCHES b/PATCHES index 9585164..1124220 100644 --- a/PATCHES +++ b/PATCHES @@ -1,7 +1,7 @@ actualfullscreen quitprompt - fullgaps + status2d extrabar gaplessgrid diff --git a/config.def.h b/config.def.h index 6eecdb7..1507a8d 100644 --- a/config.def.h +++ b/config.def.h @@ -4,6 +4,7 @@ /* appearance */ static const unsigned int borderpx = 4; /* border pixel of windows */ +static const unsigned int gappx = 15; /* gaps between windows */ static const unsigned int snap = 32; /* snap pixel */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ @@ -126,7 +127,6 @@ static const Key keys[] = { // { SUPERKEY, XK_period, focusmon, {.i = +1 } }, // { SUPERKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, // { SUPERKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, -// { SUPERKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, { SUPERKEY|ShiftMask, XK_f, togglefullscr, {0} }, TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) diff --git a/config.h b/config.h index 6eecdb7..1507a8d 100644 --- a/config.h +++ b/config.h @@ -4,6 +4,7 @@ /* appearance */ static const unsigned int borderpx = 4; /* border pixel of windows */ +static const unsigned int gappx = 15; /* gaps between windows */ static const unsigned int snap = 32; /* snap pixel */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ @@ -126,7 +127,6 @@ static const Key keys[] = { // { SUPERKEY, XK_period, focusmon, {.i = +1 } }, // { SUPERKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, // { SUPERKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, -// { SUPERKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, { SUPERKEY|ShiftMask, XK_f, togglefullscr, {0} }, TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) diff --git a/dwm b/dwm index ac5f006..4766577 100755 Binary files a/dwm and b/dwm differ diff --git a/dwm.c b/dwm.c index 23362db..6af7a32 100644 --- a/dwm.c +++ b/dwm.c @@ -116,9 +116,10 @@ struct Monitor { float mfact; int nmaster; int num; - int by; /* bar geometry */ - int mx, my, mw, mh; /* screen size */ - int wx, wy, ww, wh; /* window area */ + int by; /* bar geometry */ + int mx, my, mw, mh; /* screen size */ + int wx, wy, ww, wh; /* window area */ + int gappx; /* gaps between windows */ unsigned int seltags; unsigned int sellt; unsigned int tagset[2]; @@ -644,6 +645,7 @@ createmon(void) m->nmaster = nmaster; m->showbar = showbar; m->topbar = topbar; + m->gappx = gappx; m->lt[0] = &layouts[0]; m->lt[1] = &layouts[1 % LENGTH(layouts)]; strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); @@ -1725,18 +1727,18 @@ tile(Monitor *m) if (n > m->nmaster) mw = m->nmaster ? m->ww * m->mfact : 0; else - mw = m->ww; - for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - h = (m->wh - my) / (MIN(n, m->nmaster) - i); - resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); - if (my + HEIGHT(c) < m->wh) - my += HEIGHT(c); - } else { - h = (m->wh - ty) / (n - i); - resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); - if (ty + HEIGHT(c) < m->wh) - ty += HEIGHT(c); + mw = m->ww - m->gappx; + for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) + if (i < m->nmaster) { + h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx; + resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) - m->gappx, h - (2*c->bw), 0); + if (my + HEIGHT(c) + m->gappx < m->wh) + my += HEIGHT(c) + m->gappx; + } else { + h = (m->wh - ty) / (n - i) - m->gappx; + resize(c, m->wx + mw + m->gappx, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gappx, h - (2*c->bw), 0); + if (ty + HEIGHT(c) + m->gappx < m->wh) + ty += HEIGHT(c) + m->gappx; } } diff --git a/dwm.o b/dwm.o index f14b70e..33ddb64 100644 Binary files a/dwm.o and b/dwm.o differ