[wiki] [sites] added border width option patch || 0x1bi

From: <git_AT_suckless.org>
Date: Mon, 17 Feb 2020 17:08:55 +0100

commit a112ffa16bd2235f5726d6a11d76bf1d02ac974b
Author: 0x1bi <ben_AT_0x1bi.net>
Date: Mon Feb 17 11:08:50 2020 -0500

    added border width option patch

diff --git a/tools.suckless.org/dmenu/patches/border/dmenu-borderoption-20200217-bf60a1e.diff b/tools.suckless.org/dmenu/patches/border/dmenu-borderoption-20200217-bf60a1e.diff
new file mode 100644
index 00000000..b9b57260
--- /dev/null
+++ b/tools.suckless.org/dmenu/patches/border/dmenu-borderoption-20200217-bf60a1e.diff
_AT_@ -0,0 +1,46 @@
+From bf60a1eaf98c7aebae51021914e35bc73dd8c23e Mon Sep 17 00:00:00 2001
+From: 0x1bi <ben_AT_0x1bi.net>
+Date: Mon, 17 Feb 2020 11:02:35 -0500
+Subject: [PATCH] added border with option
+
+
+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 65f25ce..f0c3c6f 100644
+--- a/dmenu.c
++++ b/dmenu.c
+_AT_@ -659,9 +659,11 @@ setup(void)
+ swa.override_redirect = True;
+ swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
+ swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
+- win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0,
++ win = XCreateWindow(dpy, parentwin, 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_@ -733,6 +735,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();
+
+--
+2.24.1
+
diff --git a/tools.suckless.org/dmenu/patches/border/index.md b/tools.suckless.org/dmenu/patches/border/index.md
index 656ba4fc..42aa237a 100644
--- a/tools.suckless.org/dmenu/patches/border/index.md
+++ b/tools.suckless.org/dmenu/patches/border/index.md
_AT_@ -17,3 +17,23 @@ Download
 Authors
 -------
 * Leon Plickat <leonhenrik.plickat[at]stud.uni-goettingen.de>
+
+border command line option
+==========================
+
+Description
+-----------
+This patch is a derivative of the previous patch. The border witdh can be
+specified through the command line using the -bw option. Width defaults to 0.
+
+Create menu with border width 3:
+
+ echo 'item1
item2
item3' | dmenu -bw 3
+
+Download
+--------
+* [dmenu-borderoption-20200217-bf60a1e.diff](dmenu-borderoption-20200217-bf60a1e.diff) (17.02.2020)
+
+Authors
+-------
+* Ben Raskin <ben[at]0x1bi.net>
Received on Mon Feb 17 2020 - 17:08:55 CET

This archive was generated by hypermail 2.3.0 : Mon Feb 17 2020 - 17:12:35 CET