Browse Source

added bar border patch!

siduck76 4 years ago
parent
commit
5f8df23a1f
8 changed files with 90 additions and 111 deletions
  1. 0 48
      chadwm/README
  2. 0 1
      chadwm/config.def.h
  3. 32 1
      chadwm/config.def.h.orig
  4. 4 3
      chadwm/config.h
  5. BIN
      chadwm/dwm
  6. 23 16
      chadwm/dwm.c
  7. 31 42
      chadwm/dwm.c.orig
  8. BIN
      chadwm/dwm.o

+ 0 - 48
chadwm/README

@@ -1,48 +0,0 @@
-dwm - dynamic window manager
-============================
-dwm is an extremely fast, small, and dynamic window manager for X.
-
-
-Requirements
-------------
-In order to build dwm you need the Xlib header files.
-
-
-Installation
-------------
-Edit config.mk to match your local setup (dwm is installed into
-the /usr/local namespace by default).
-
-Afterwards enter the following command to build and install dwm (if
-necessary as root):
-
-    make clean install
-
-
-Running dwm
------------
-Add the following line to your .xinitrc to start dwm using startx:
-
-    exec dwm
-
-In order to connect dwm to a specific display, make sure that
-the DISPLAY environment variable is set correctly, e.g.:
-
-    DISPLAY=foo.bar:1 exec dwm
-
-(This will start dwm on display :1 of the host foo.bar.)
-
-In order to display status info in the bar, you can do something
-like this in your .xinitrc:
-
-    while xsetroot -name "`date` `uptime | sed 's/.*,//'`"
-    do
-    	sleep 1
-    done &
-    exec dwm
-
-
-Configuration
--------------
-The configuration of dwm is done by creating a custom config.h
-and (re)compiling the source code.

+ 0 - 1
chadwm/config.def.h

@@ -9,7 +9,6 @@ static const int systraypinningfailfirst = 1;   /* 1: if pinning fails,display s
 static const int showsystray        = 1;     /* 0 means no systray */
 static const int showsystray        = 1;     /* 0 means no systray */
 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 */
-static const int user_bh            = 0;        /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */
 static const char *fonts[]          = { "monospace:size=10" };
 static const char *fonts[]          = { "monospace:size=10" };
 static const char dmenufont[]       = "monospace:size=10";
 static const char dmenufont[]       = "monospace:size=10";
 static const char col_gray1[]       = "#222222";
 static const char col_gray1[]       = "#222222";

+ 32 - 1
chadwm/config.def.h.orig

@@ -47,11 +47,26 @@ static const int nmaster     = 1;    /* number of clients in master area */
 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
 
 
+#define FORCE_VSPLIT 1  /* nrowgrid layout: force two clients to always split vertically */
+#include "vanitygaps.c"
+
 static const Layout layouts[] = {
 static const Layout layouts[] = {
 	/* symbol     arrange function */
 	/* symbol     arrange function */
 	{ "[]=",      tile },    /* first entry is default */
 	{ "[]=",      tile },    /* first entry is default */
-	{ "><>",      NULL },    /* no layout function means floating behavior */
 	{ "[M]",      monocle },
 	{ "[M]",      monocle },
+	{ "[@]",      spiral },
+	{ "[\\]",     dwindle },
+	{ "H[]",      deck },
+	{ "TTT",      bstack },
+	{ "===",      bstackhoriz },
+	{ "HHH",      grid },
+	{ "###",      nrowgrid },
+	{ "---",      horizgrid },
+	{ ":::",      gaplessgrid },
+	{ "|M|",      centeredmaster },
+	{ ">M>",      centeredfloatingmaster },
+	{ "><>",      NULL },    /* no layout function means floating behavior */
+	{ NULL,       NULL },
 };
 };
 
 
 /* key definitions */
 /* key definitions */
@@ -87,6 +102,22 @@ static Key keys[] = {
 	{ MODKEY|ShiftMask,             XK_l,      setcfact,       {.f = -0.25} },
 	{ MODKEY|ShiftMask,             XK_l,      setcfact,       {.f = -0.25} },
 	{ MODKEY|ShiftMask,             XK_o,      setcfact,       {.f =  0.00} },
 	{ MODKEY|ShiftMask,             XK_o,      setcfact,       {.f =  0.00} },
 	{ MODKEY,                       XK_Return, zoom,           {0} },
 	{ MODKEY,                       XK_Return, zoom,           {0} },
+	{ MODKEY|Mod4Mask,              XK_u,      incrgaps,       {.i = +1 } },
+	{ MODKEY|Mod4Mask|ShiftMask,    XK_u,      incrgaps,       {.i = -1 } },
+	{ MODKEY|Mod4Mask,              XK_i,      incrigaps,      {.i = +1 } },
+	{ MODKEY|Mod4Mask|ShiftMask,    XK_i,      incrigaps,      {.i = -1 } },
+	{ MODKEY|Mod4Mask,              XK_o,      incrogaps,      {.i = +1 } },
+	{ MODKEY|Mod4Mask|ShiftMask,    XK_o,      incrogaps,      {.i = -1 } },
+	{ MODKEY|Mod4Mask,              XK_6,      incrihgaps,     {.i = +1 } },
+	{ MODKEY|Mod4Mask|ShiftMask,    XK_6,      incrihgaps,     {.i = -1 } },
+	{ MODKEY|Mod4Mask,              XK_7,      incrivgaps,     {.i = +1 } },
+	{ MODKEY|Mod4Mask|ShiftMask,    XK_7,      incrivgaps,     {.i = -1 } },
+	{ MODKEY|Mod4Mask,              XK_8,      incrohgaps,     {.i = +1 } },
+	{ MODKEY|Mod4Mask|ShiftMask,    XK_8,      incrohgaps,     {.i = -1 } },
+	{ MODKEY|Mod4Mask,              XK_9,      incrovgaps,     {.i = +1 } },
+	{ MODKEY|Mod4Mask|ShiftMask,    XK_9,      incrovgaps,     {.i = -1 } },
+	{ MODKEY|Mod4Mask,              XK_0,      togglegaps,     {0} },
+	{ MODKEY|Mod4Mask|ShiftMask,    XK_0,      defaultgaps,    {0} },
 	{ MODKEY,                       XK_Tab,    view,           {0} },
 	{ MODKEY,                       XK_Tab,    view,           {0} },
 	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
 	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },

+ 4 - 3
chadwm/config.h

@@ -17,7 +17,8 @@ static const int systraypinningfailfirst = 1;   /* 1: if pinning fails,display s
 static const int showsystray        = 1;     /* 0 means no systray */
 static const int showsystray        = 1;     /* 0 means no systray */
 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 */
-static const int user_bh            = 26;        /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */
+static const int horizpadbar        = 10;
+static const int vertpadbar         = 10;
 static const char *fonts[]          = { "JetBrainsMono Nerd Font:style:bold:size=10",
 static const char *fonts[]          = { "JetBrainsMono Nerd Font:style:bold:size=10",
                                 	"Material Design Icons-Regular:size=10",
                                 	"Material Design Icons-Regular:size=10",
 };
 };
@@ -29,6 +30,7 @@ static const char col_gray3[]       = "#abb2bf";
 static const char col_gray4[]       = "#6d8dad";
 static const char col_gray4[]       = "#6d8dad";
 static const char col_cyann[]       = "#81A1C1";
 static const char col_cyann[]       = "#81A1C1";
 static const char col_bg2[]         = "#3b414d";
 static const char col_bg2[]         = "#3b414d";
+static const char col_borderbar[]   = "#2E3440";
 
 
 static const char *colors[][3]      = {
 static const char *colors[][3]      = {
 	/*               fg         bg         border   */
 	/*               fg         bg         border   */
@@ -108,8 +110,7 @@ static const char *xd[] = {"xbacklight", "-dec", "7", NULL};
 static Key keys[] = {
 static Key keys[] = {
 	/* modifier                     key        function        argument */
 	/* modifier                     key        function        argument */
 	{ MODKEY,                       XK_c,      spawn,          {.v = rofi } },
 	{ MODKEY,                       XK_c,      spawn,          {.v = rofi } },
-        { MODKEY,                       XK_Return,      spawn,          {.v = termcmd } },
-//	{ MODKEY,                       XK_Return, spawn,   SHCMD("~/.local/bin/./st_settings && st")},
+	{ MODKEY,                       XK_Return, spawn,   SHCMD("~/.local/bin/./st_settings && st")},
         {MODKEY | ControlMask, XK_u, spawn, SHCMD("maim | xclip -selection clipboard -t image/png")},
         {MODKEY | ControlMask, XK_u, spawn, SHCMD("maim | xclip -selection clipboard -t image/png")},
         {MODKEY, XK_u, spawn,   SHCMD("maim --select | xclip -selection clipboard -t image/png")},
         {MODKEY, XK_u, spawn,   SHCMD("maim --select | xclip -selection clipboard -t image/png")},
         {0, XF86MonBrightnessDown, spawn, {.v = xd}},
         {0, XF86MonBrightnessDown, spawn, {.v = xd}},

BIN
chadwm/dwm


+ 23 - 16
chadwm/dwm.c

@@ -314,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;
@@ -862,15 +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;
-        x = m->ww - w - getsystraywidth();
+        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;
@@ -880,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;
 
 
@@ -910,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);
 				}
 				}
@@ -924,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]);
@@ -1234,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);
@@ -1253,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;
@@ -2246,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 = 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);
@@ -2281,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 */

+ 31 - 42
chadwm/dwm.c.orig

@@ -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)
 {
 {

BIN
chadwm/dwm.o