[wiki] [sites] Added updated xyw patch for dmenu-5.2. Modified the index file to reflect the changes || Michael Johnson

From: <git_AT_suckless.org>
Date: Sun, 24 Mar 2024 06:18:43 +0100

commit 5e815661f0d7bc9488500a4ce8a5296f898983a0
Author: Michael Johnson <yuyuyak_AT_gmail.com>
Date: Sat Mar 23 22:16:02 2024 -0700

    Added updated xyw patch for dmenu-5.2. Modified the index file to reflect the changes

diff --git a/tools.suckless.org/dmenu/patches/xyw/dmenu-xyw-5.2.diff b/tools.suckless.org/dmenu/patches/xyw/dmenu-xyw-5.2.diff
new file mode 100644
index 00000000..312fb260
--- /dev/null
+++ b/tools.suckless.org/dmenu/patches/xyw/dmenu-xyw-5.2.diff
_AT_@ -0,0 +1,99 @@
+--- a/dmenu.1 2022-10-04 10:36:58.000000000 -0700
++++ b/dmenu.1 2024-03-23 19:40:27.116453289 -0700
+_AT_@ -8,6 +8,12 @@
+ .IR lines ]
+ .RB [ \-m
+ .IR monitor ]
++.RB [ \-x
++.IR xoffset ]
++.RB [ \-y
++.IR yoffset ]
++.RB [ \-z
++.IR width ]
+ .RB [ \-p
+ .IR prompt ]
+ .RB [ \-fn
+_AT_@ -54,6 +60,24 @@
+ dmenu is displayed on the monitor number supplied. Monitor numbers are starting
+ from 0.
+ .TP
++.BI \-x " xoffset"
++dmenu is placed at this offset measured from the left side of the monitor.
++Can be negative.
++If option
++.B \-m
++is present, the measurement will use the given monitor.
++.TP
++.BI \-y " yoffset"
++dmenu is placed at this offset measured from the top of the monitor. If the
++.B \-b
++option is used, the offset is measured from the bottom. Can be negative.
++If option
++.B \-m
++is present, the measurement will use the given monitor.
++.TP
++.BI \-z " width"
++sets the width of the dmenu window.
++.TP
+ .BI \-p " prompt"
+ defines the prompt to be displayed to the left of the input field.
+ .TP
+--- a/dmenu.c 2022-10-04 10:36:58.000000000 -0700
++++ b/dmenu.c 2024-03-23 19:39:53.173081139 -0700
+_AT_@ -37,6 +37,9 @@
+ static char text[BUFSIZ] = "";
+ static char *embed;
+ static int bh, mw, mh;
++static int dmx = 0; /* put dmenu at this x offset */
++static int dmy = 0; /* put dmenu at this y offset (measured from the bottom if topbar is 0) */
++static unsigned int dmw = 0; /* make dmenu this wide */
+ static int inputw = 0, promptw;
+ static int lrpad; /* sum of left and right padding */
+ static size_t cursor;
+_AT_@ -658,9 +661,9 @@
+ if (INTERSECT(x, y, 1, 1, info[i]) != 0)
+ break;
+
+- x = info[i].x_org;
+- y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
+- mw = info[i].width;
++ x = info[i].x_org + dmx;
++ y = info[i].y_org + (topbar ? dmy : info[i].height - mh - dmy);
++ mw = (dmw>0 ? dmw : info[i].width);;
+ XFree(info);
+ } else
+ #endif
+_AT_@ -668,9 +671,9 @@
+ if (!XGetWindowAttributes(dpy, parentwin, &wa))
+ die("could not get embedding window attributes: 0x%lx",
+ parentwin);
+- x = 0;
+- y = topbar ? 0 : wa.height - mh;
+- mw = wa.width;
++ x = dmx;
++ y = topbar ? dmy : wa.height - mh - dmy;
++ mw = (dmw>0 ? dmw : wa.width);
+ }
+ promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
+ inputw = mw / 3; /* input width: ~33% of monitor width */
+_AT_@ -711,6 +714,7 @@
+ usage(void)
+ {
+ die("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]
"
++ " [-x xoffset] [-y yoffset] [-z width]
"
+ " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]");
+ }
+
+_AT_@ -737,6 +741,12 @@
+ /* these options take one argument */
+ else if (!strcmp(argv[i], "-l")) /* number of lines in vertical list */
+ lines = atoi(argv[++i]);
++ else if (!strcmp(argv[i], "-x")) /* window x offset */
++ dmx = atoi(argv[++i]);
++ else if (!strcmp(argv[i], "-y")) /* window y offset (from bottom up if -b) */
++ dmy = atoi(argv[++i]);
++ else if (!strcmp(argv[i], "-z")) /* make dmenu this wide */
++ dmw = atoi(argv[++i]);
+ else if (!strcmp(argv[i], "-m"))
+ mon = atoi(argv[++i]);
+ else if (!strcmp(argv[i], "-p")) /* adds prompt to left of input field */
diff --git a/tools.suckless.org/dmenu/patches/xyw/index.md b/tools.suckless.org/dmenu/patches/xyw/index.md
index 3221a1f0..6a8adbb0 100644
--- a/tools.suckless.org/dmenu/patches/xyw/index.md
+++ b/tools.suckless.org/dmenu/patches/xyw/index.md
_AT_@ -10,9 +10,12 @@ The patch adds options for setting window position and width.
 
 Please note that for the 5.0 version, the width parameter is '-z' to avoid conflict with '-w windowid'.
 If this change is not desired, the 4.7 version applies fine, but '-w windowid' will not work.
+This change was carried on through the 5.2 version, necessitated by failure of the 5.0 version on dmenu-5.2,
+hence -z is now the only option to preserve the '-w windowid' function.
 
 Download
 --------
+* [dmenu-xyw-5.2.diff](dmenu-xyw-5.2.diff)
 * [dmenu-xyw-5.0.diff](dmenu-xyw-5.0.diff)
 * [dmenu-xyw-4.7.diff](dmenu-xyw-4.7.diff)
 * [dmenu-xyw-20171207-f0a5b75.diff](dmenu-xyw-20171207-f0a5b75.diff)
_AT_@ -24,3 +27,4 @@ Author
 * Xarchus
 * Jonathon Fernyhough (jonathon at manjaro-dot-org) (4.7 rewrite)
 * Alex Cole <ajzcole_AT_airmail.cc> (changes in the 5.0 version)
+* Mike Johnson (slayinlay at gmail-dot-com) (5.2 update)
Received on Sun Mar 24 2024 - 06:18:43 CET

This archive was generated by hypermail 2.3.0 : Sun Mar 24 2024 - 06:24:50 CET