summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]LICENSE0
-rwxr-xr-x[-rw-r--r--]Makefile0
-rwxr-xr-x[-rw-r--r--]README0
-rwxr-xr-x[-rw-r--r--]config.h19
-rwxr-xr-x[-rw-r--r--]config.mk0
-rwxr-xr-x[-rw-r--r--]drw.c0
-rwxr-xr-x[-rw-r--r--]drw.h0
-rwxr-xr-xdwmbin74496 -> 74928 bytes
-rwxr-xr-x[-rw-r--r--]dwm.10
-rwxr-xr-x[-rw-r--r--]dwm.c106
-rw-r--r--dwm.obin61248 -> 62760 bytes
-rwxr-xr-x[-rw-r--r--]dwm.pngbin373 -> 373 bytes
-rwxr-xr-x[-rw-r--r--]fibonacci.c0
-rwxr-xr-x[-rw-r--r--]patch/dwm-fibonacci-20200418-c82db69.diff0
-rwxr-xr-x[-rw-r--r--]patch/dwm-focusonclick-20200110-61bb8b2.diff0
-rwxr-xr-x[-rw-r--r--]patch/dwm-fullgaps-20200508-7b77734.diff0
-rwxr-xr-x[-rw-r--r--]patch/dwm-statusallmons-20160731-56a31dc.diff0
-rwxr-xr-x[-rw-r--r--]patch/dwm-swallow-6.2.diff0
-rwxr-xr-x[-rw-r--r--]patch/dwm-vanitygaps-20200610-f09418b.diff72
-rwxr-xr-x[-rw-r--r--]transient.c0
-rwxr-xr-x[-rw-r--r--]util.c0
-rwxr-xr-x[-rw-r--r--]util.h0
22 files changed, 118 insertions, 79 deletions
diff --git a/LICENSE b/LICENSE
index 995172f..995172f 100644..100755
--- a/LICENSE
+++ b/LICENSE
diff --git a/Makefile b/Makefile
index 77bcbc0..77bcbc0 100644..100755
--- a/Makefile
+++ b/Makefile
diff --git a/README b/README
index 95d4fd0..95d4fd0 100644..100755
--- a/README
+++ b/README
diff --git a/config.h b/config.h
index 38b16fd..9283c62 100644..100755
--- a/config.h
+++ b/config.h
@@ -3,6 +3,11 @@
/* appearance */
static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
+static const unsigned int gappih = 10; /* horiz inner gap between windows */
+static const unsigned int gappiv = 10; /* vert inner gap between windows */
+static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */
+static const unsigned int gappov = 10; /* vert outer gap between windows and screen edge */
+static const int smartgaps = 0; /* 1 means no outer gap when there is only one window */
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
@@ -82,6 +87,14 @@ static Key keys[] = {
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
+ { MODKEY, XK_minus, incrgaps, {.i = +1 } },
+ { MODKEY, XK_equal, incrgaps, {.i = -1 } },
+ { MODKEY|ShiftMask, XK_minus, incrogaps, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_equal, incrogaps, {.i = -1 } },
+ { MODKEY|ControlMask, XK_minus, incrigaps, {.i = +1 } },
+ { MODKEY|ControlMask, XK_equal, incrigaps, {.i = -1 } },
+ { MODKEY, XK_0, togglegaps, {0} },
+ { MODKEY|ShiftMask, XK_0, defaultgaps, {0} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
@@ -91,13 +104,13 @@ static Key keys[] = {
{ MODKEY, XK_r, setlayout, {.v = &layouts[3]} },
{ MODKEY|ShiftMask, XK_r, setlayout, {.v = &layouts[4]} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
- { MODKEY, XK_0, view, {.ui = ~0 } },
- { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
+ /* { MODKEY, XK_0, view, {.ui = ~0 } }, */
+ /* { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, */
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
- { MODKEY, XK_b, spawn, SHCMD("/home/cafebabe/Software/firefox/firefox") },
+ { MODKEY, XK_b, spawn, SHCMD("firefox") },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
diff --git a/config.mk b/config.mk
index 5e8e0e0..5e8e0e0 100644..100755
--- a/config.mk
+++ b/config.mk
diff --git a/drw.c b/drw.c
index 85fe42f..85fe42f 100644..100755
--- a/drw.c
+++ b/drw.c
diff --git a/drw.h b/drw.h
index 6471431..6471431 100644..100755
--- a/drw.h
+++ b/drw.h
diff --git a/dwm b/dwm
index 9492eba..c8c515e 100755
--- a/dwm
+++ b/dwm
Binary files differ
diff --git a/dwm.1 b/dwm.1
index ddc8321..ddc8321 100644..100755
--- a/dwm.1
+++ b/dwm.1
diff --git a/dwm.c b/dwm.c
index c10f08c..859efd9 100644..100755
--- a/dwm.c
+++ b/dwm.c
@@ -128,6 +128,10 @@ struct Monitor {
int by; /* bar geometry */
int mx, my, mw, mh; /* screen size */
int wx, wy, ww, wh; /* window area */
+ int gappih; /* horizontal gap between windows */
+ int gappiv; /* vertical gap between windows */
+ int gappoh; /* horizontal outer gaps */
+ int gappov; /* vertical outer gaps */
int gappx; /* gaps between windows */
unsigned int seltags;
unsigned int sellt;
@@ -210,6 +214,12 @@ static void sendmon(Client *c, Monitor *m);
static void setclientstate(Client *c, long state);
static void setfocus(Client *c);
static void setfullscreen(Client *c, int fullscreen);
+static void setgaps(int oh, int ov, int ih, int iv);
+static void incrgaps(const Arg *arg);
+static void incrigaps(const Arg *arg);
+static void incrogaps(const Arg *arg);
+static void togglegaps(const Arg *arg);
+static void defaultgaps(const Arg *arg);
static void setlayout(const Arg *arg);
static void setmfact(const Arg *arg);
static void setup(void);
@@ -257,6 +267,7 @@ static char stext[256];
static int screen;
static int sw, sh; /* X display screen geometry width, height */
static int bh; /* bar height */
+static int enablegaps = 1; /* enables gaps, used by togglegaps */
static int lrpad; /* sum of left and right padding for text */
static int (*xerrorxlib)(Display *, XErrorEvent *);
static unsigned int numlockmask = 0;
@@ -708,6 +719,10 @@ createmon(void)
m->nmaster = nmaster;
m->showbar = showbar;
m->topbar = topbar;
+ m->gappih = gappih;
+ m->gappiv = gappiv;
+ m->gappoh = gappoh;
+ m->gappov = gappov;
m->lt[0] = &layouts[0];
m->lt[1] = &layouts[1 % LENGTH(layouts)];
strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
@@ -1536,6 +1551,67 @@ setfullscreen(Client *c, int fullscreen)
}
void
+setgaps(int oh, int ov, int ih, int iv)
+{
+ if (oh < 0) oh = 0;
+ if (ov < 0) ov = 0;
+ if (ih < 0) ih = 0;
+ if (iv < 0) iv = 0;
+
+ selmon->gappoh = oh;
+ selmon->gappov = ov;
+ selmon->gappih = ih;
+ selmon->gappiv = iv;
+ arrange(selmon);
+}
+
+void
+togglegaps(const Arg *arg)
+{
+ enablegaps = !enablegaps;
+ arrange(selmon);
+}
+
+void
+defaultgaps(const Arg *arg)
+{
+ setgaps(gappoh, gappov, gappih, gappiv);
+}
+
+void
+incrgaps(const Arg *arg)
+{
+ setgaps(
+ selmon->gappoh + arg->i,
+ selmon->gappov + arg->i,
+ selmon->gappih + arg->i,
+ selmon->gappiv + arg->i
+ );
+}
+
+void
+incrigaps(const Arg *arg)
+{
+ setgaps(
+ selmon->gappoh,
+ selmon->gappov,
+ selmon->gappih + arg->i,
+ selmon->gappiv + arg->i
+ );
+}
+
+void
+incrogaps(const Arg *arg)
+{
+ setgaps(
+ selmon->gappoh + arg->i,
+ selmon->gappov + arg->i,
+ selmon->gappih,
+ selmon->gappiv
+ );
+}
+
+void
setlayout(const Arg *arg)
{
if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
@@ -1708,28 +1784,34 @@ tagmon(const Arg *arg)
void
tile(Monitor *m)
{
- unsigned int i, n, h, mw, my, ty;
+ unsigned int i, n, h, r, oe = enablegaps, ie = enablegaps, mw, my, ty;
Client *c;
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
if (n == 0)
return;
+ if (smartgaps == n) {
+ oe = 0; // outer gaps disabled
+ }
+
if (n > m->nmaster)
- mw = m->nmaster ? m->ww * m->mfact : 0;
+ mw = m->nmaster ? (m->ww + m->gappiv*ie) * m->mfact : 0;
else
- mw = m->ww;
- for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ mw = m->ww - 2*m->gappov*oe + m->gappiv*ie;
+ for (i = 0, my = ty = m->gappoh*oe, 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);
+ r = MIN(n, m->nmaster) - i;
+ h = (m->wh - my - m->gappoh*oe - m->gappih*ie * (r - 1)) / r;
+ resize(c, m->wx + m->gappov*oe, m->wy + my, mw - (2*c->bw) - m->gappiv*ie, h - (2*c->bw), 0);
+ if (my + HEIGHT(c) + m->gappih*ie < m->wh)
+ my += HEIGHT(c) + m->gappih*ie;
} 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);
+ r = n - i;
+ h = (m->wh - ty - m->gappoh*oe - m->gappih*ie * (r - 1)) / r;
+ resize(c, m->wx + mw + m->gappov*oe, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gappov*oe, h - (2*c->bw), 0);
+ if (ty + HEIGHT(c) + m->gappih*ie < m->wh)
+ ty += HEIGHT(c) + m->gappih*ie;
}
}
diff --git a/dwm.o b/dwm.o
index 1dc2f2a..e26d1bf 100644
--- a/dwm.o
+++ b/dwm.o
Binary files differ
diff --git a/dwm.png b/dwm.png
index b1f9ba7..b1f9ba7 100644..100755
--- a/dwm.png
+++ b/dwm.png
Binary files differ
diff --git a/fibonacci.c b/fibonacci.c
index fce0a57..fce0a57 100644..100755
--- a/fibonacci.c
+++ b/fibonacci.c
diff --git a/patch/dwm-fibonacci-20200418-c82db69.diff b/patch/dwm-fibonacci-20200418-c82db69.diff
index 81bba7a..81bba7a 100644..100755
--- a/patch/dwm-fibonacci-20200418-c82db69.diff
+++ b/patch/dwm-fibonacci-20200418-c82db69.diff
diff --git a/patch/dwm-focusonclick-20200110-61bb8b2.diff b/patch/dwm-focusonclick-20200110-61bb8b2.diff
index 59c7a1d..59c7a1d 100644..100755
--- a/patch/dwm-focusonclick-20200110-61bb8b2.diff
+++ b/patch/dwm-focusonclick-20200110-61bb8b2.diff
diff --git a/patch/dwm-fullgaps-20200508-7b77734.diff b/patch/dwm-fullgaps-20200508-7b77734.diff
index 368c871..368c871 100644..100755
--- a/patch/dwm-fullgaps-20200508-7b77734.diff
+++ b/patch/dwm-fullgaps-20200508-7b77734.diff
diff --git a/patch/dwm-statusallmons-20160731-56a31dc.diff b/patch/dwm-statusallmons-20160731-56a31dc.diff
index 126d974..126d974 100644..100755
--- a/patch/dwm-statusallmons-20160731-56a31dc.diff
+++ b/patch/dwm-statusallmons-20160731-56a31dc.diff
diff --git a/patch/dwm-swallow-6.2.diff b/patch/dwm-swallow-6.2.diff
index 5324024..5324024 100644..100755
--- a/patch/dwm-swallow-6.2.diff
+++ b/patch/dwm-swallow-6.2.diff
diff --git a/patch/dwm-vanitygaps-20200610-f09418b.diff b/patch/dwm-vanitygaps-20200610-f09418b.diff
index c8b13b2..b921e76 100644..100755
--- a/patch/dwm-vanitygaps-20200610-f09418b.diff
+++ b/patch/dwm-vanitygaps-20200610-f09418b.diff
@@ -28,22 +28,14 @@ index 1c0b587..0927c2d 100644
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
-+ { MODKEY|Mod4Mask, XK_h, incrgaps, {.i = +1 } },
-+ { MODKEY|Mod4Mask, XK_l, incrgaps, {.i = -1 } },
-+ { MODKEY|Mod4Mask|ShiftMask, XK_h, incrogaps, {.i = +1 } },
-+ { MODKEY|Mod4Mask|ShiftMask, XK_l, incrogaps, {.i = -1 } },
-+ { MODKEY|Mod4Mask|ControlMask, XK_h, incrigaps, {.i = +1 } },
-+ { MODKEY|Mod4Mask|ControlMask, XK_l, incrigaps, {.i = -1 } },
-+ { MODKEY|Mod4Mask, XK_0, togglegaps, {0} },
-+ { MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} },
-+ { MODKEY, XK_y, incrihgaps, {.i = +1 } },
-+ { MODKEY, XK_o, incrihgaps, {.i = -1 } },
-+ { MODKEY|ControlMask, XK_y, incrivgaps, {.i = +1 } },
-+ { MODKEY|ControlMask, XK_o, incrivgaps, {.i = -1 } },
-+ { MODKEY|Mod4Mask, XK_y, incrohgaps, {.i = +1 } },
-+ { MODKEY|Mod4Mask, XK_o, incrohgaps, {.i = -1 } },
-+ { MODKEY|ShiftMask, XK_y, incrovgaps, {.i = +1 } },
-+ { MODKEY|ShiftMask, XK_o, incrovgaps, {.i = -1 } },
++ { MODKEY, XK_-, incrgaps, {.i = +1 } },
++ { MODKEY, XK_=, incrgaps, {.i = -1 } },
++ { MODKEY|ShiftMask, XK_-, incrogaps, {.i = +1 } },
++ { MODKEY|ShiftMask, XK_=, incrogaps, {.i = -1 } },
++ { MODKEY|ControlMask, XK_-, incrigaps, {.i = +1 } },
++ { MODKEY|ControlMask, XK_=, incrigaps, {.i = -1 } },
++ { MODKEY, XK_0, togglegaps, {0} },
++ { MODKEY|ShiftMask, XK_0, defaultgaps, {0} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
@@ -70,10 +62,6 @@ index 9fd0286..50dbbaf 100644
+static void incrgaps(const Arg *arg);
+static void incrigaps(const Arg *arg);
+static void incrogaps(const Arg *arg);
-+static void incrohgaps(const Arg *arg);
-+static void incrovgaps(const Arg *arg);
-+static void incrihgaps(const Arg *arg);
-+static void incrivgaps(const Arg *arg);
+static void togglegaps(const Arg *arg);
+static void defaultgaps(const Arg *arg);
static void setlayout(const Arg *arg);
@@ -163,50 +151,6 @@ index 9fd0286..50dbbaf 100644
+ );
+}
+
-+void
-+incrohgaps(const Arg *arg)
-+{
-+ setgaps(
-+ selmon->gappoh + arg->i,
-+ selmon->gappov,
-+ selmon->gappih,
-+ selmon->gappiv
-+ );
-+}
-+
-+void
-+incrovgaps(const Arg *arg)
-+{
-+ setgaps(
-+ selmon->gappoh,
-+ selmon->gappov + arg->i,
-+ selmon->gappih,
-+ selmon->gappiv
-+ );
-+}
-+
-+void
-+incrihgaps(const Arg *arg)
-+{
-+ setgaps(
-+ selmon->gappoh,
-+ selmon->gappov,
-+ selmon->gappih + arg->i,
-+ selmon->gappiv
-+ );
-+}
-+
-+void
-+incrivgaps(const Arg *arg)
-+{
-+ setgaps(
-+ selmon->gappoh,
-+ selmon->gappov,
-+ selmon->gappih,
-+ selmon->gappiv + arg->i
-+ );
-+}
-+
void
setlayout(const Arg *arg)
{
diff --git a/transient.c b/transient.c
index 040adb5..040adb5 100644..100755
--- a/transient.c
+++ b/transient.c
diff --git a/util.c b/util.c
index 96b82c9..96b82c9 100644..100755
--- a/util.c
+++ b/util.c
diff --git a/util.h b/util.h
index f633b51..f633b51 100644..100755
--- a/util.h
+++ b/util.h