|
@@ -138,6 +138,10 @@ struct Monitor {
|
|
int by; /* bar geometry */
|
|
int by; /* bar geometry */
|
|
int mx, my, mw, mh; /* screen size */
|
|
int mx, my, mw, mh; /* screen size */
|
|
int wx, wy, ww, wh; /* window area */
|
|
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 */
|
|
unsigned int borderpx;
|
|
unsigned int borderpx;
|
|
unsigned int seltags;
|
|
unsigned int seltags;
|
|
unsigned int sellt;
|
|
unsigned int sellt;
|
|
@@ -249,7 +253,6 @@ static void spawn(const Arg *arg);
|
|
static Monitor *systraytomon(Monitor *m);
|
|
static Monitor *systraytomon(Monitor *m);
|
|
static void tag(const Arg *arg);
|
|
static void tag(const Arg *arg);
|
|
static void tagmon(const Arg *arg);
|
|
static void tagmon(const Arg *arg);
|
|
-static void tile(Monitor *);
|
|
|
|
static void togglebar(const Arg *arg);
|
|
static void togglebar(const Arg *arg);
|
|
static void togglefloating(const Arg *arg);
|
|
static void togglefloating(const Arg *arg);
|
|
static void togglefullscr(const Arg *arg);
|
|
static void togglefullscr(const Arg *arg);
|
|
@@ -311,7 +314,7 @@ static Atom wmatom[WMLast], netatom[NetLast], xatom[XLast];
|
|
static int restart = 0;
|
|
static int restart = 0;
|
|
static int running = 1;
|
|
static int running = 1;
|
|
static Cur *cursor[CurLast];
|
|
static Cur *cursor[CurLast];
|
|
-static Clr **scheme;
|
|
|
|
|
|
+static Clr **scheme, clrborder;
|
|
static Display *dpy;
|
|
static Display *dpy;
|
|
static Drw *drw;
|
|
static Drw *drw;
|
|
static Monitor *mons, *selmon;
|
|
static Monitor *mons, *selmon;
|
|
@@ -740,6 +743,10 @@ createmon(void)
|
|
m->nmaster = nmaster;
|
|
m->nmaster = nmaster;
|
|
m->showbar = showbar;
|
|
m->showbar = showbar;
|
|
m->topbar = topbar;
|
|
m->topbar = topbar;
|
|
|
|
+ m->gappih = gappih;
|
|
|
|
+ m->gappiv = gappiv;
|
|
|
|
+ m->gappoh = gappoh;
|
|
|
|
+ m->gappov = gappov;
|
|
m->borderpx = borderpx;
|
|
m->borderpx = borderpx;
|
|
m->lt[0] = &layouts[0];
|
|
m->lt[0] = &layouts[0];
|
|
m->lt[1] = &layouts[1 % LENGTH(layouts)];
|
|
m->lt[1] = &layouts[1 % LENGTH(layouts)];
|
|
@@ -855,14 +862,16 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
|
|
isCode = 0;
|
|
isCode = 0;
|
|
text = p;
|
|
text = p;
|
|
|
|
|
|
- w += 2; /* 1px padding on both sides */
|
|
|
|
- ret = x = m->ww - w;
|
|
|
|
|
|
+ w += horizpadbar;
|
|
|
|
+ ret = x = m->ww - borderpx - w;
|
|
|
|
+ x = m->ww - borderpx - w - getsystraywidth();
|
|
|
|
|
|
drw_setscheme(drw, scheme[LENGTH(colors)]);
|
|
drw_setscheme(drw, scheme[LENGTH(colors)]);
|
|
drw->scheme[ColFg] = scheme[SchemeNorm][ColFg];
|
|
drw->scheme[ColFg] = scheme[SchemeNorm][ColFg];
|
|
drw->scheme[ColBg] = scheme[SchemeNorm][ColBg];
|
|
drw->scheme[ColBg] = scheme[SchemeNorm][ColBg];
|
|
- drw_rect(drw, x, 0, w, bh, 1, 1);
|
|
|
|
- x++;
|
|
|
|
|
|
+ drw_rect(drw, x, borderpx, w, bh, 1, 1);
|
|
|
|
+ x += horizpadbar / 2;
|
|
|
|
+
|
|
|
|
|
|
/* process status text */
|
|
/* process status text */
|
|
i = -1;
|
|
i = -1;
|
|
@@ -872,7 +881,7 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
|
|
|
|
|
|
text[i] = '\0';
|
|
text[i] = '\0';
|
|
w = TEXTW(text) - lrpad;
|
|
w = TEXTW(text) - lrpad;
|
|
- drw_text(drw, x, 0, w, bh, 0, text, 0);
|
|
|
|
|
|
+ drw_text(drw, x, borderpx + vertpadbar / 2, w, bh - vertpadbar, 0, text, 0);
|
|
|
|
|
|
x += w;
|
|
x += w;
|
|
|
|
|
|
@@ -902,7 +911,7 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
|
|
while (text[++i] != ',');
|
|
while (text[++i] != ',');
|
|
int rh = atoi(text + ++i);
|
|
int rh = atoi(text + ++i);
|
|
|
|
|
|
- drw_rect(drw, rx + x, ry, rw, rh, 1, 0);
|
|
|
|
|
|
+ drw_rect(drw, rx + x, ry + borderpx + vertpadbar / 2, rw, rh, 1, 0);
|
|
} else if (text[i] == 'f') {
|
|
} else if (text[i] == 'f') {
|
|
x += atoi(text + ++i);
|
|
x += atoi(text + ++i);
|
|
}
|
|
}
|
|
@@ -916,7 +925,7 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
|
|
|
|
|
|
if (!isCode) {
|
|
if (!isCode) {
|
|
w = TEXTW(text) - lrpad;
|
|
w = TEXTW(text) - lrpad;
|
|
- drw_text(drw, x, 0, w, bh, 0, text, 0);
|
|
|
|
|
|
+ drw_text(drw, x, borderpx + vertpadbar / 2, w, bh - vertpadbar, 0, text, 0);
|
|
}
|
|
}
|
|
|
|
|
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
|
@@ -1226,17 +1235,22 @@ dragmfact(const Arg *arg)
|
|
void
|
|
void
|
|
drawbar(Monitor *m)
|
|
drawbar(Monitor *m)
|
|
{
|
|
{
|
|
- int x, w, sw = 0, stw = 0;
|
|
|
|
|
|
+ int x, y = borderpx, w, sw = 0, stw = 0;
|
|
|
|
+ int th = bh - borderpx * 2;
|
|
|
|
+ int mw = m->ww - borderpx * 2;
|
|
int boxs = drw->fonts->h / 9;
|
|
int boxs = drw->fonts->h / 9;
|
|
int boxw = drw->fonts->h / 6 + 2;
|
|
int boxw = drw->fonts->h / 6 + 2;
|
|
unsigned int i, occ = 0, urg = 0;
|
|
unsigned int i, occ = 0, urg = 0;
|
|
Client *c;
|
|
Client *c;
|
|
|
|
|
|
|
|
+ XSetForeground(drw->dpy, drw->gc, clrborder.pixel);
|
|
|
|
+ XFillRectangle(drw->dpy, drw->drawable, drw->gc, 0, 0, m->ww, bh);
|
|
|
|
+
|
|
if(showsystray && m == systraytomon(m))
|
|
if(showsystray && m == systraytomon(m))
|
|
|
|
|
|
/* draw status first so it can be overdrawn by tags later */
|
|
/* draw status first so it can be overdrawn by tags later */
|
|
if (m == selmon) { /* status is only drawn on selected monitor */
|
|
if (m == selmon) { /* status is only drawn on selected monitor */
|
|
- sw = m->ww - drawstatusbar(m, bh, stext);
|
|
|
|
|
|
+ sw = mw - drawstatusbar(m, th, stext);
|
|
}
|
|
}
|
|
|
|
|
|
resizebarwin(m);
|
|
resizebarwin(m);
|
|
@@ -1245,15 +1259,15 @@ drawbar(Monitor *m)
|
|
if (c->isurgent)
|
|
if (c->isurgent)
|
|
urg |= c->tags;
|
|
urg |= c->tags;
|
|
}
|
|
}
|
|
- x = 0;
|
|
|
|
|
|
+ x = borderpx;
|
|
for (i = 0; i < LENGTH(tags); i++) {
|
|
for (i = 0; i < LENGTH(tags); i++) {
|
|
w = TEXTW(tags[i]);
|
|
w = TEXTW(tags[i]);
|
|
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
|
|
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
|
|
- drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
|
|
|
|
|
|
+ drw_text(drw, x, y, w, th, lrpad / 2, tags[i], urg & 1 << i);
|
|
if (ulineall || m->tagset[m->seltags] & 1 << i) /* if there are conflicts, just move these lines directly underneath both 'drw_setscheme' and 'drw_text' :) */
|
|
if (ulineall || m->tagset[m->seltags] & 1 << i) /* if there are conflicts, just move these lines directly underneath both 'drw_setscheme' and 'drw_text' :) */
|
|
- drw_rect(drw, x + ulinepad, bh - ulinestroke - ulinevoffset, w - (ulinepad * 2), ulinestroke, 1, 0);
|
|
|
|
|
|
+ drw_rect(drw, x + ulinepad, th - ulinestroke - ulinevoffset, w - (ulinepad * 2), ulinestroke, 1, 0);
|
|
if (occ & 1 << i)
|
|
if (occ & 1 << i)
|
|
- drw_rect(drw, x + boxs, boxs, boxw, boxw,
|
|
|
|
|
|
+ drw_rect(drw, x + boxs, y+ boxs, boxw, boxw,
|
|
m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
|
|
m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
|
|
urg & 1 << i);
|
|
urg & 1 << i);
|
|
x += w;
|
|
x += w;
|
|
@@ -2238,7 +2252,7 @@ setup(void)
|
|
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
|
|
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
|
|
die("no fonts could be loaded.");
|
|
die("no fonts could be loaded.");
|
|
lrpad = drw->fonts->h;
|
|
lrpad = drw->fonts->h;
|
|
- bh = user_bh ? user_bh : drw->fonts->h + 2;
|
|
|
|
|
|
+ bh = user_bh ? user_bh : drw->fonts->h + 2 + vertpadbar + borderpx * 2;
|
|
updategeom();
|
|
updategeom();
|
|
/* init atoms */
|
|
/* init atoms */
|
|
utf8string = XInternAtom(dpy, "UTF8_STRING", False);
|
|
utf8string = XInternAtom(dpy, "UTF8_STRING", False);
|
|
@@ -2273,6 +2287,7 @@ setup(void)
|
|
scheme[LENGTH(colors)] = drw_scm_create(drw, colors[0], 3);
|
|
scheme[LENGTH(colors)] = drw_scm_create(drw, colors[0], 3);
|
|
for (i = 0; i < LENGTH(colors); i++)
|
|
for (i = 0; i < LENGTH(colors); i++)
|
|
scheme[i] = drw_scm_create(drw, colors[i], 3);
|
|
scheme[i] = drw_scm_create(drw, colors[i], 3);
|
|
|
|
+ drw_clr_create(drw, &clrborder, col_borderbar);
|
|
/* init system tray */
|
|
/* init system tray */
|
|
updatesystray();
|
|
updatesystray();
|
|
/* init bars */
|
|
/* init bars */
|
|
@@ -2389,32 +2404,6 @@ tagmon(const Arg *arg)
|
|
sendmon(selmon->sel, dirtomon(arg->i));
|
|
sendmon(selmon->sel, dirtomon(arg->i));
|
|
}
|
|
}
|
|
|
|
|
|
-void
|
|
|
|
-tile(Monitor *m)
|
|
|
|
-{
|
|
|
|
- unsigned int i, n, h, mw, my, ty;
|
|
|
|
- Client *c;
|
|
|
|
-
|
|
|
|
- for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
|
|
|
|
- if (n == 0)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- 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);
|
|
|
|
- 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);
|
|
|
|
- ty += HEIGHT(c);
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
void
|
|
void
|
|
togglebar(const Arg *arg)
|
|
togglebar(const Arg *arg)
|
|
{
|
|
{
|