commit c89cc807b9f9164baf339fef703e1043cfdbcc5b
parent ca3f09c6f44f13df7a2976cb502ff4331cd237a1
Author: Markus Hanetzok <markus@hanetzok.net>
Date: Sun, 14 May 2023 01:21:24 +0200
[dmenu][patch][border] Update patch and add separate color option
This commit contains an update to the original border patch, making it
compatible with 0fe460d and a new patch, that separates border color
from SelBg.
Diffstat:
3 files changed, 120 insertions(+), 0 deletions(-)
diff --git a/tools.suckless.org/dmenu/patches/border/dmenu-border-20230512-0fe460d.diff b/tools.suckless.org/dmenu/patches/border/dmenu-border-20230512-0fe460d.diff
@@ -0,0 +1,36 @@
+diff --git a/config.def.h b/config.def.h
+index 1edb647..dd3eb31 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -21,3 +21,6 @@ static unsigned int lines = 0;
+ * for example: " /?\"&[]"
+ */
+ static const char worddelimiters[] = " ";
++
++/* Size of the window border */
++static unsigned int border_width = 0;
+diff --git a/dmenu.c b/dmenu.c
+index 27b7a30..7c130fc 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -684,9 +684,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[SchemeSel][ColBg].pixel);
+ XSetClassHint(dpy, win, &ch);
+
+
+@@ -757,6 +759,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();
diff --git a/tools.suckless.org/dmenu/patches/border/dmenu-bordercolor-20230512-0fe460d.diff b/tools.suckless.org/dmenu/patches/border/dmenu-bordercolor-20230512-0fe460d.diff
@@ -0,0 +1,71 @@
+From 8dbea77ad7b320d9c7e07990274ea74835785084 Mon Sep 17 00:00:00 2001
+From: Markus Hanetzok <markus@hanetzok.net>
+Date: Sun, 14 May 2023 01:04:09 +0200
+Subject: [PATCH] Makes border colors independent from SelBg
+---
+ 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..ae41b06 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 = 0;
++
+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 */
+ }
++
+--
+2.40.1
diff --git a/tools.suckless.org/dmenu/patches/border/index.md b/tools.suckless.org/dmenu/patches/border/index.md
@@ -14,6 +14,7 @@ Download
--------
* [dmenu-border-4.9.diff](dmenu-border-4.9.diff) (2019-05-19)
* [dmenu-border-5.2.diff](dmenu-border-5.2.diff) (2023-01-20)
+* [dmenu-border-20230512-0fe460d](dmenu-border-20230512-0fe460d.diff) (2023-05-12)
Authors
-------
@@ -39,3 +40,15 @@ Download
Authors
-------
* Ben Raskin <ben[at]0x1bi.net>
+
+separate border color
+=====================
+
+Description
+-----------
+This patch is based on the border patch, but adds another colorscheme to
+set the border color independently from SelBg
+
+Download
+--------
+* [dmenu-bordercolor-20230512-0fe460d](dmenu-bordercolor-20230512-0fe460d.diff) (2023-05-12)