From 8298215af08fe64bd8ae86ac4bd93279be3cc797 Mon Sep 17 00:00:00 2001
From: Andreev Gregory <1@example.com>
Date: Mon, 3 Mar 2025 15:06:21 +0300
Subject: [PATCH] Applied bordercolor patch

---
 config.def.h | 5 +++++
 dmenu.c      | 9 +++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/config.def.h b/config.def.h
index 1edb647..1316812 100644
--- a/config.def.h
+++ b/config.def.h
@@ -12,6 +12,7 @@ static const char *colors[SchemeLast][2] = {
 	[SchemeNorm] = { "#bbbbbb", "#222222" },
 	[SchemeSel] = { "#eeeeee", "#005577" },
 	[SchemeOut] = { "#000000", "#00ffff" },
+	[SchemeBorder] = { "#cccccc", NULL },
 };
 /* -l option; if nonzero, dmenu uses vertical list with given number of lines */
 static unsigned int lines      = 0;
@@ -21,3 +22,7 @@ static unsigned int lines      = 0;
  * for example: " /?\"&[]"
  */
 static const char worddelimiters[] = " ";
+
+/* Size of the window border */
+static unsigned int border_width = 3;
+
diff --git a/dmenu.c b/dmenu.c
index 62f1089..7f063b6 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -26,7 +26,7 @@
 #define TEXTW(X)              (drw_fontset_getwidth(drw, (X)) + lrpad)
 
 /* enums */
-enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
+enum { SchemeNorm, SchemeSel, SchemeOut, SchemeBorder, SchemeLast }; /* color schemes */
 
 struct item {
 	char *text;
@@ -685,9 +685,11 @@ setup(void)
 	swa.override_redirect = True;
 	swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
 	swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
-	win = XCreateWindow(dpy, root, x, y, mw, mh, 0,
+	win = XCreateWindow(dpy, root, x, y, mw, mh, border_width,
 	                    CopyFromParent, CopyFromParent, CopyFromParent,
 	                    CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
+	if (border_width)
+		XSetWindowBorder(dpy, win, scheme[SchemeBorder][ColFg].pixel);
 	XSetClassHint(dpy, win, &ch);
 
 
@@ -759,6 +761,8 @@ main(int argc, char *argv[])
 			colors[SchemeSel][ColFg] = argv[++i];
 		else if (!strcmp(argv[i], "-w"))   /* embedding window id */
 			embed = argv[++i];
+		else if (!strcmp(argv[i], "-bw"))
+			border_width = atoi(argv[++i]); /* border width */
 		else
 			usage();
 
@@ -795,3 +799,4 @@ main(int argc, char *argv[])
 
 	return 1; /* unreachable */
 }
+