Merged with gap patch + added a lot of fixes to my config + removed config.h
This commit is contained in:
commit
c094ad31c3
5
Makefile
5
Makefile
@ -11,10 +11,7 @@ all: dwm
|
|||||||
.c.o:
|
.c.o:
|
||||||
${CC} -c ${CFLAGS} $<
|
${CC} -c ${CFLAGS} $<
|
||||||
|
|
||||||
${OBJ}: config.h config.mk
|
${OBJ}: config.def.h config.mk
|
||||||
|
|
||||||
config.h:
|
|
||||||
cp config.def.h $@
|
|
||||||
|
|
||||||
dwm: ${OBJ}
|
dwm: ${OBJ}
|
||||||
${CC} -o $@ ${OBJ} ${LDFLAGS}
|
${CC} -o $@ ${OBJ} ${LDFLAGS}
|
||||||
|
11
config.def.h
11
config.def.h
@ -20,7 +20,8 @@ void toggle_keyboard_layout(const Arg* arg) {
|
|||||||
// Normal config.def.h continues. I just added some of my own functions
|
// Normal config.def.h continues. I just added some of my own functions
|
||||||
|
|
||||||
/* appearance */
|
/* appearance */
|
||||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
static const unsigned int borderpx = 2; /* border pixel of windows */
|
||||||
|
static const unsigned int gappx = 2; /* gap pixel between windows */
|
||||||
static const unsigned int snap = 32; /* snap pixel */
|
static const unsigned int snap = 32; /* snap pixel */
|
||||||
static const int showbar = 1; /* 0 means no bar */
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
static const int topbar = 1; /* 0 means bottom bar */
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
@ -81,8 +82,8 @@ static const Key keys[] = {
|
|||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
{ MODKEY, XK_space, toggle_keyboard_layout, {0} },
|
{ MODKEY, XK_space, toggle_keyboard_layout, {0} },
|
||||||
{ MODKEY, XK_r, spawn, {.v = dmenucmd } },
|
{ MODKEY, XK_r, spawn, {.v = dmenucmd } },
|
||||||
{ MODKEY|ControlMask, XK_Return, spawn, {.v = termcmd } },
|
{ MODKEY|ControlMask, XK_s, spawn, {.v = termcmd } },
|
||||||
{ MODKEY, XK_Return, spawn, {.v = termtmuxzshcmd } },
|
{ MODKEY, XK_s, spawn, {.v = termtmuxzshcmd } },
|
||||||
{ MODKEY|ControlMask, XK_n, spawn, {.v = flexcmd } },
|
{ MODKEY|ControlMask, XK_n, spawn, {.v = flexcmd } },
|
||||||
{ MODKEY, XK_b, togglebar, {0} },
|
{ MODKEY, XK_b, togglebar, {0} },
|
||||||
{ MODKEY, XK_k, focusstack, {.i = +1 } },
|
{ MODKEY, XK_k, focusstack, {.i = +1 } },
|
||||||
@ -91,14 +92,14 @@ static const Key keys[] = {
|
|||||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||||
{ MODKEY, XK_j, setmfact, {.f = -0.05} },
|
{ MODKEY, XK_j, setmfact, {.f = -0.05} },
|
||||||
{ MODKEY, XK_semicolon , setmfact, {.f = +0.05} },
|
{ MODKEY, XK_semicolon , setmfact, {.f = +0.05} },
|
||||||
{ MODKEY|ControlMask, XK_Return, zoom, {0} },
|
{ MODKEY, XK_Return, zoom, {0} },
|
||||||
{ MODKEY, XK_Tab, view, {0} },
|
{ MODKEY, XK_Tab, view, {0} },
|
||||||
{ MODKEY|Mod1Mask , XK_c, killclient, {0} },
|
{ MODKEY|Mod1Mask , XK_c, killclient, {0} },
|
||||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||||
//{ MODKEY, XK_space, setlayout, {0} },
|
//{ MODKEY, XK_space, setlayout, {0} },
|
||||||
//{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
{ MODKEY|ControlMask, XK_space, togglefloating, {0} },
|
||||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||||
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||||
|
29
dwm.c
29
dwm.c
@ -268,7 +268,7 @@ static Monitor *mons, *selmon;
|
|||||||
static Window root, wmcheckwin;
|
static Window root, wmcheckwin;
|
||||||
|
|
||||||
/* configuration, allows nested code to access above variables */
|
/* configuration, allows nested code to access above variables */
|
||||||
#include "config.h"
|
#include "config.def.h"
|
||||||
|
|
||||||
/* compile-time check if all tags fit into an unsigned int bit array. */
|
/* compile-time check if all tags fit into an unsigned int bit array. */
|
||||||
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
|
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
|
||||||
@ -1683,10 +1683,10 @@ tagmon(const Arg *arg)
|
|||||||
sendmon(selmon->sel, dirtomon(arg->i));
|
sendmon(selmon->sel, dirtomon(arg->i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note: There was thishuge conflict with 6.0+gaps patch and I merged it almost blindly. Have no guarantees that it willwork correctly
|
||||||
void
|
void
|
||||||
tile(Monitor *m)
|
tile(Monitor *m) {
|
||||||
{
|
unsigned int i, n, h, r, g = 0, mw, my, ty;
|
||||||
unsigned int i, n, h, mw, my, ty;
|
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
|
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
|
||||||
@ -1694,20 +1694,21 @@ tile(Monitor *m)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(n > m->nmaster)
|
if(n > m->nmaster)
|
||||||
mw = m->nmaster ? m->ww * m->mfact : 0;
|
mw = m->nmaster ? (m->ww - (g = gappx)) * m->mfact : 0;
|
||||||
else
|
else
|
||||||
mw = m->ww;
|
mw = m->ww;
|
||||||
for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
|
for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
|
||||||
if(i < m->nmaster) {
|
if(i < m->nmaster) {
|
||||||
h = (m->wh - my) / (MIN(n, m->nmaster) - i);
|
r = MIN(n, m->nmaster) - i;
|
||||||
resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0);
|
h = (m->wh - my - gappx * (r - 1)) / r;
|
||||||
if (my + HEIGHT(c) < m->wh)
|
resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
|
||||||
my += HEIGHT(c);
|
my += HEIGHT(c) + gappx;
|
||||||
} else {
|
}
|
||||||
h = (m->wh - ty) / (n - i);
|
else {
|
||||||
resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0);
|
r = n - i;
|
||||||
if (ty + HEIGHT(c) < m->wh)
|
h = (m->wh - ty - gappx * (r - 1)) / r;
|
||||||
ty += HEIGHT(c);
|
resize(c, m->wx + mw + g, m->wy + ty, m->ww - mw - g - (2*c->bw), h - (2*c->bw), False);
|
||||||
|
ty += HEIGHT(c) + gappx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user