commit 6f691846092bfa30adbb05e9d3022e2358f50a80
parent 574ea6cb23c757212994ead204246e679e2a76c6
Author: Erik Letson <hmagellan@hmagellan.com>
Date: Sat, 15 Aug 2020 15:58:24 -0500
Readme and borderoption patch
Diffstat:
3 files changed, 126 insertions(+), 0 deletions(-)
diff --git a/README b/README
@@ -0,0 +1,62 @@
+suckless-gf-dmenu - Gentoo-Friendly Patches for Suckless's dmenu
+
+== What Is This? ==
+
+ This repository contains a host of patches that can be applied to dmenu, the dynamic menu for X from suckless.org. These
+patches have been modified to work with Gentoo's dmenu package, and are specifically compatible with the 'savedconfig' USE flag. Each
+patch in this repository has its own directory. Each of these directories contains the actual patch file itself (ending in '.patch',
+for Portage compatibility reasons), and a file called USAGE that informs the user of any manual changes that should or might be
+applied in order to use the patch. Be sure to read USAGE carefully before applying the patch, and follow the instructions therein!
+
+ This project exists because of a problem with the default way that Suckless programs work in a Gentoo environment. Gentoo's
+package manager, Portage, offers a built-in utility for patching programs, and this utility works nicely with the patches for dmenu
+that can be found on suckless.org. Additionally, since Portage is a source-based package manager, it also offers a utility for
+editing config.h files in Suckless programs by using the 'savedconfig' USE flag. This USE flag, when enabled, will create a directory
+in /etc/portage/savedconfig that contains a header file (this file is located in /etc/portage/savedconfig/x11-misc/ in dmenu's case).
+This header file can be edited just like the one that you would edit if you were working with a git repository or other copy of the
+dmenu code directly. Edits made to this file are applied as a diff to config.def.h at emerge time, thus providing a very simple and
+convenient way of incorporating Suckless's recommended modification methodology in a Portage-friendly fashion. There is a problem
+with this, however; because of the way that Portage patches programs as part of ebuilds, most of the time any patches that make
+changes to config.def.h themselves will be totally incompatible with a custom savedconfig header file, and emerge will fail if you
+try to apply such a patch while 'savedconfig' is enabled. The solution to this dilemma is to modify the patches in such a way as to
+make them never make any changes to config.def.h, and thus make them compatible with 'savedconfig' and friendly to Gentoo. Any
+changes that the patch originally tried to make to config.def.h could either be applied manually to the savedconfig header file by
+the user, or potentially included in another file as part of the patching process, depending on what the changes do.
+
+ A side-goal of this repository is to make each target patch (see below) support the current stable version of x11-terms/dmenu as
+offered by Gentoo tree (currently dmenu version 0.8.4). Many of the patches suckless-gf-dmenu targets are not themselves considered to be
+compatible with this modern version of dmenu, but the project intends to fix any compatibilty issues that the target patches have with
+the unmodified current dmenu codebase and thus make them work. This could potentially result in substantial changes coming to individual
+patches, or perhaps the total rewrite of patches altogether. Compatibility changes will be noted in individual patches' USAGE files.
+
+ These patches are ALL compatible with Portage and savedconfig. Effort has also been taken to ensure the patches are themselves
+cross-compatible; that is, that they do not conflict with each other. Despite this effort, lack of conflict between patches is not
+guaranteed at this time. If any specific patches are known to be incompatible with each other, the conflict will be noted inside the
+patches' USAGE files. Normally, this should serve to document most incompatiblities, but in the case of the user applying a great many
+patches all at once, it is possible that novel conflicts may occur. Be aware of this should you try to emerge with a huge number of
+patches!
+
+== Target Patches ==
+
+ suckless-gf-dmenu targets the patches located at the following locations:
+
+ (1). https://dmenu.suckless.org/patches/
+
+ CURRENT PROGRESS: 1/51 patches supported
+ 0/51 patches unsupported
+
+ USUPPORTED PATCHES:
+ None so far :-)
+
+ NOTE THAT UNSUPPORTED PATCHES SHOULD BE SUPPORTED IN THE FUTURE!!!
+
+== License ==
+
+ suckless-gf-dmenu is released under the MIT/X Consortium License, the same license that dmenu itself is under:
+ (https://git.suckless.org/dmenu/file/LICENSE.html)
+
+ See the LICENSE file for details.
+
+== Maintainer ==
+
+ suckless-gf-dmenu is maintained by Erik Letson <hmagellan@hmagellan.com>. Please direct any questions or patches to that email.
diff --git a/patches/border/USAGE b/patches/border/USAGE
@@ -25,3 +25,38 @@ No further action is required.
== INCOMPATIBILITIES ==
No known specific incompatibilities.
+
+###################################################################################################
+###################################################################################################
+
+borderoption - Control dmenu border width with command line option '-bw'
+Source: https://tools.suckless.org/dmenu/patches/border/dmenu-borderoption-20200217-bf60a1e.diff
+Original Author: Ben Raskin <ben[at]0x1bi.net>
+
+Description from source:
+ """
+ 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\nitem2\nitem3' | dmenu -bw 3
+ """
+
+== YOU MUST ==
+(1). Place the patch file in /etc/portage/patches/x11-misc/dmenu/
+(2). Add the following line to your savedconfig file:
+
+ static unsigned int border_width = 5;
+
+ Set the 'border_width' variable to the desired default border thickness. Notice the lack of 'const'.
+(3). Run 'emerge dmenu'
+
+== YOU PROBABLY SHOULD ==
+(1). Run 'dmenu' or 'dmenu_run' with the '-bw X' option, where 'X' is the desired thickness of the border in pixels.
+
+== PATCH MODIFICATIONS ==
+(1). Removed lines relating to config.def.h
+
+== INCOMPATIBILITIES ==
+No known specific incompatibilities.
diff --git a/patches/border/borderoption.patch b/patches/border/borderoption.patch
@@ -0,0 +1,29 @@
+diff --git a/dmenu.c b/dmenu.c
+index 65f25ce..f0c3c6f 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -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);
+
+
+@@ -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
+