[wiki] [sites] [dmenu][patch][border] Update patch and add separate color option || Markus Hanetzok

From: <git_AT_suckless.org>
Date: Sun, 14 May 2023 01:26:03 +0200

commit c89cc807b9f9164baf339fef703e1043cfdbcc5b
Author: Markus Hanetzok <markus_AT_hanetzok.net>
Date: Sun May 14 01:21:24 2023 +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.

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
new file mode 100644
index 00000000..f7a59713
--- /dev/null
+++ b/tools.suckless.org/dmenu/patches/border/dmenu-border-20230512-0fe460d.diff
_AT_@ -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
+_AT_@ -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
+_AT_@ -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);
+
+
+_AT_@ -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
new file mode 100644
index 00000000..6bf629b9
--- /dev/null
+++ b/tools.suckless.org/dmenu/patches/border/dmenu-bordercolor-20230512-0fe460d.diff
_AT_@ -0,0 +1,71 @@
+From 8dbea77ad7b320d9c7e07990274ea74835785084 Mon Sep 17 00:00:00 2001
+From: Markus Hanetzok <markus_AT_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
+_AT_@ -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;
+_AT_@ -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
+_AT_@ -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;
+_AT_@ -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);
+
+
+_AT_@ -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();
+
+_AT_@ -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
index 7eee89d6..8a2690c3 100644
--- a/tools.suckless.org/dmenu/patches/border/index.md
+++ b/tools.suckless.org/dmenu/patches/border/index.md
_AT_@ -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
 -------
_AT_@ -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)
Received on Sun May 14 2023 - 01:26:03 CEST

This archive was generated by hypermail 2.3.0 : Sun May 14 2023 - 01:36:50 CEST