From a37700ee0e77c23120747b9f45fef91243d86ec3 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Thu, 7 May 2020 21:10:33 +0000 Subject: [PATCH] Add center patch --- .suckless/dmenu/config.h | 4 +- .suckless/dmenu/config.h.orig | 23 ++++ .suckless/dmenu/dmenu | Bin 43840 -> 43912 bytes .suckless/dmenu/dmenu.1 | 3 + .suckless/dmenu/dmenu.c | 39 +++++- .../dmenu-center-20200111-8cd37e1.diff | 120 ++++++++++++++++++ 6 files changed, 181 insertions(+), 8 deletions(-) create mode 100644 .suckless/dmenu/config.h.orig create mode 100644 .suckless/dmenu/patches/dmenu-center-20200111-8cd37e1.diff diff --git a/.suckless/dmenu/config.h b/.suckless/dmenu/config.h index 4df799e..21408ef 100644 --- a/.suckless/dmenu/config.h +++ b/.suckless/dmenu/config.h @@ -2,6 +2,8 @@ /* Default settings; can be overriden by command line. */ static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ +static int centered = 1; /* -c option; centers dmenu on screen */ +static int min_width = 500; /* minimum width when centered */ /* -fn option overrides fonts[0]; default X11 font or font set */ static const char *fonts[] = { "Iosevka:size=12" @@ -14,7 +16,7 @@ static const char *colors[SchemeLast][2] = { [SchemeOut] = { "#000000", "#00ffff" }, }; /* -l option; if nonzero, dmenu uses vertical list with given number of lines */ -static unsigned int lines = 20; +static unsigned int lines = 10; /* * Characters not considered part of a word while deleting words diff --git a/.suckless/dmenu/config.h.orig b/.suckless/dmenu/config.h.orig new file mode 100644 index 0000000..4df799e --- /dev/null +++ b/.suckless/dmenu/config.h.orig @@ -0,0 +1,23 @@ +/* See LICENSE file for copyright and license details. */ +/* Default settings; can be overriden by command line. */ + +static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ +/* -fn option overrides fonts[0]; default X11 font or font set */ +static const char *fonts[] = { + "Iosevka:size=12" +}; +static const char *prompt = NULL; /* -p option; prompt to the left of input field */ +static const char *colors[SchemeLast][2] = { + /* fg bg */ + [SchemeNorm] = { "#bbbbbb", "#222222" }, + [SchemeSel] = { "#eeeeee", "#005577" }, + [SchemeOut] = { "#000000", "#00ffff" }, +}; +/* -l option; if nonzero, dmenu uses vertical list with given number of lines */ +static unsigned int lines = 20; + +/* + * Characters not considered part of a word while deleting words + * for example: " /?\"&[]" + */ +static const char worddelimiters[] = " "; diff --git a/.suckless/dmenu/dmenu b/.suckless/dmenu/dmenu index 436964944cc345cd183874830cc6cb35c10b2a84..12f21994cd61c567cda04cf50ffc41d7334f3d0c 100755 GIT binary patch delta 11491 zcmaKS3w%u1_WzlaoM{qdg2W_|R4^eAA%l=nQyC_lFv!zeQEySDCTNR^CQ;`e(_*WZ z>)ztFzqb18i#|MBLOgqw@Y8riQ5QYws7D{DtLFb*`<(Q){{R2)d_J?++G~B++H0@< zID4O@x=vhnN?Z}!Vs^H`pB$YCVQ;KVJ0Brs=~XF!KUlyrXm$5w4sqkWxUMps) z;=9pTt1l<6Ub(4qO{*#I?;rd_+>PVD|JtgF8!YkT9Xjr9zfQw+B1AdZrWTz|E!goE z*0}g5b!im)GpHRiwY0{i8QP?Wv|X7U+Fph>^C4~DtrJ>Cw-9rq+5F_k!~~IjoNVv) zdJ{pA{aKdBK$IKWYrh49Rn=vdgVKqaddm&F(Jvrw_Ro;`d{z4&1cQz3tUbFroDYH7z~7K8-FE_-b?nNHV-Uvbc{eSXbNN+A%~@B&&5aNkSdL`p^k`>mBcFUB3Kpj_qJeQ-i#8Ea z5%K=jwnJo$ME{F-u&gCi*<9uP97|F=l19E`G9Xg329)}!=1f7&tybDj!d6{ws|C^K zB?-a~N(8z;Vg~sX^Y#UYV>O@IbFb=O4|vh=47imVT#lpK69&Xd#%XF+jsaR zYpN;HKz|d3ene<>AewIhB#6LArhaJ(yzLP6MnA@!mld~7rXpYani^G|!vJhVY~lzh z9U|>hUET8!YNo5BN&Tv>&H-;ffgXjRA#_KecC}K5R9Qku=2S@L_u4vX!Cz?T_apz7${&#` zC}%?H@lUd)c!0?CD3?6SZEe8aU{FmQjL53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`;rI~XTfiw9 zU{0geW}Zy01)=r7A(Hia>;FIW*6XeR@i4I7R`aR>{@CZWg@*k4sJb==V@4iJSej<& z&74b<`%I+Shlfv9&@}vvLWHnLmlu!{4=oCkH|DX`OIKvnV$Y^$1*M0F;u?f_p?nRm z3K(ksJjo`#V2Q5+Pg>U_+Bs|$wAH#cMAy=spyzqE8(O>(^1#u5;6mX&jR?!x4=-5k zt5GA*-!M(wYWoVRllk}=VtiE-}n=kF*e8RRsyA2%Ku6!hu2KFtq2cacfuahhUVVXvSCKe@IyeCj2?f1I2HJ=v9 z4Vc%JQ#80yx4Ng}CqJ$Up3~(~XdU@!*5!wE1NxgZ<+e=Et#x!dYjXCs92MU~$D};c z_H1@Uw%Go_wQ+(<9ge59p9>(Th;QlhME@5a!Od(hTH?!etJAtwYur(6613xVt)OR> zrMVWSvQ^N|;@WuhkS1=8Sj~1r`@F7IAJKZ*4=-B0HP8kNKLm7#|0XnBDcgyyo3*Z4 zsmoVBB7aktH$5V!PgT^PReE$(`E!uVW7rEylGSZbd3mwvYVm5t{BvjR>2$c89J_(etLApPqf(!*O0-=H;)vG_xNV?{}1G z#K-60K&M={>9Ygh_4xBRM~-Am)>sUaIgdVt)pNXD&CB{ zf8*tLULIttUg=$QD@1EyyGO>BuE5mtd_ChzJ%fl)ZOkV=GUi=a=T|K(<<&TYlQ=^K zFK6;{2`^t}TOfa(^P7433eEQTf50O}dS372fqJC99CMV)`13mEw2t8yGvL1E+UvS@ zPO4_QB}${%cMvg%ZCr~rwss`TdhKA_e%XTOf6bcL%igaa3tHE`zTdj=uzKmOi9yEO znQZghy~0{I2wbNwzP;4oW-~VRj>?~=d2FR|^?%FoCA9-$l7Y7z^} OcqiBJPd4eDZvO*xPfqv% diff --git a/.suckless/dmenu/dmenu.1 b/.suckless/dmenu/dmenu.1 index 323f93c..c036baa 100644 --- a/.suckless/dmenu/dmenu.1 +++ b/.suckless/dmenu/dmenu.1 @@ -40,6 +40,9 @@ which lists programs in the user's $PATH and runs the result in their $SHELL. .B \-b dmenu appears at the bottom of the screen. .TP +.B \-c +dmenu appears centered on the screen. +.TP .B \-f dmenu grabs the keyboard before reading stdin if not reading from a tty. This is faster, but will lock up X until stdin reaches end\-of\-file. diff --git a/.suckless/dmenu/dmenu.c b/.suckless/dmenu/dmenu.c index 65f25ce..041c7f8 100644 --- a/.suckless/dmenu/dmenu.c +++ b/.suckless/dmenu/dmenu.c @@ -89,6 +89,15 @@ calcoffsets(void) break; } +static int +max_textw(void) +{ + int len = 0; + for (struct item *item = items; item && item->text; item++) + len = MAX(TEXTW(item->text), len); + return len; +} + static void cleanup(void) { @@ -611,6 +620,7 @@ setup(void) bh = drw->fonts->h + 2; lines = MAX(lines, 0); mh = (lines + 1) * bh; + promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0; #ifdef XINERAMA i = 0; if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) { @@ -637,9 +647,16 @@ setup(void) if (INTERSECT(x, y, 1, 1, info[i])) break; - x = info[i].x_org; - y = info[i].y_org + (topbar ? 0 : info[i].height - mh); - mw = info[i].width; + if (centered) { + mw = MIN(MAX(max_textw() + promptw, min_width), info[i].width); + x = info[i].x_org + ((info[i].width - mw) / 2); + y = info[i].y_org + ((info[i].height - mh) / 2); + } else { + x = info[i].x_org; + y = info[i].y_org + (topbar ? 0 : info[i].height - mh); + mw = info[i].width; + } + XFree(info); } else #endif @@ -647,11 +664,17 @@ setup(void) 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; + + if (centered) { + mw = MIN(MAX(max_textw() + promptw, min_width), wa.width); + x = (wa.width - mw) / 2; + y = (wa.height - mh) / 2; + } else { + x = 0; + y = topbar ? 0 : wa.height - mh; + mw = wa.width; + } } - promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0; inputw = MIN(inputw, mw/3); match(); @@ -709,6 +732,8 @@ main(int argc, char *argv[]) topbar = 0; else if (!strcmp(argv[i], "-f")) /* grabs keyboard before reading stdin */ fast = 1; + else if (!strcmp(argv[i], "-c")) /* centers dmenu on screen */ + centered = 1; else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */ fstrncmp = strncasecmp; fstrstr = cistrstr; diff --git a/.suckless/dmenu/patches/dmenu-center-20200111-8cd37e1.diff b/.suckless/dmenu/patches/dmenu-center-20200111-8cd37e1.diff new file mode 100644 index 0000000..765f859 --- /dev/null +++ b/.suckless/dmenu/patches/dmenu-center-20200111-8cd37e1.diff @@ -0,0 +1,120 @@ +From 8cd37e1ab9e7cb025224aeb3543f1a5be8bceb93 Mon Sep 17 00:00:00 2001 +From: Nihal Jere +Date: Sat, 11 Jan 2020 21:16:08 -0600 +Subject: [PATCH] center patch now has adjustable minimum width + +--- + config.h | 2 ++ + dmenu.1 | 3 +++ + dmenu.c | 39 ++++++++++++++++++++++++++++++++------- + 3 files changed, 37 insertions(+), 7 deletions(-) + +diff --git a/config.h b/config.h +index 1edb647..88ef264 100644 +--- a/config.h ++++ b/config.h +@@ -2,6 +2,8 @@ + /* Default settings; can be overriden by command line. */ + + static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ ++static int centered = 0; /* -c option; centers dmenu on screen */ ++static int min_width = 500; /* minimum width when centered */ + /* -fn option overrides fonts[0]; default X11 font or font set */ + static const char *fonts[] = { + "monospace:size=10" +diff --git a/dmenu.1 b/dmenu.1 +index 323f93c..c036baa 100644 +--- a/dmenu.1 ++++ b/dmenu.1 +@@ -40,6 +40,9 @@ which lists programs in the user's $PATH and runs the result in their $SHELL. + .B \-b + dmenu appears at the bottom of the screen. + .TP ++.B \-c ++dmenu appears centered on the screen. ++.TP + .B \-f + dmenu grabs the keyboard before reading stdin if not reading from a tty. This + is faster, but will lock up X until stdin reaches end\-of\-file. +diff --git a/dmenu.c b/dmenu.c +index 65f25ce..041c7f8 100644 +--- a/dmenu.c ++++ b/dmenu.c +@@ -89,6 +89,15 @@ calcoffsets(void) + break; + } + ++static int ++max_textw(void) ++{ ++ int len = 0; ++ for (struct item *item = items; item && item->text; item++) ++ len = MAX(TEXTW(item->text), len); ++ return len; ++} ++ + static void + cleanup(void) + { +@@ -611,6 +620,7 @@ setup(void) + bh = drw->fonts->h + 2; + lines = MAX(lines, 0); + mh = (lines + 1) * bh; ++ promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0; + #ifdef XINERAMA + i = 0; + if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) { +@@ -637,9 +647,16 @@ setup(void) + if (INTERSECT(x, y, 1, 1, info[i])) + break; + +- x = info[i].x_org; +- y = info[i].y_org + (topbar ? 0 : info[i].height - mh); +- mw = info[i].width; ++ if (centered) { ++ mw = MIN(MAX(max_textw() + promptw, min_width), info[i].width); ++ x = info[i].x_org + ((info[i].width - mw) / 2); ++ y = info[i].y_org + ((info[i].height - mh) / 2); ++ } else { ++ x = info[i].x_org; ++ y = info[i].y_org + (topbar ? 0 : info[i].height - mh); ++ mw = info[i].width; ++ } ++ + XFree(info); + } else + #endif +@@ -647,11 +664,17 @@ setup(void) + 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; ++ ++ if (centered) { ++ mw = MIN(MAX(max_textw() + promptw, min_width), wa.width); ++ x = (wa.width - mw) / 2; ++ y = (wa.height - mh) / 2; ++ } else { ++ x = 0; ++ y = topbar ? 0 : wa.height - mh; ++ mw = wa.width; ++ } + } +- promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0; + inputw = MIN(inputw, mw/3); + match(); + +@@ -709,6 +732,8 @@ main(int argc, char *argv[]) + topbar = 0; + else if (!strcmp(argv[i], "-f")) /* grabs keyboard before reading stdin */ + fast = 1; ++ else if (!strcmp(argv[i], "-c")) /* centers dmenu on screen */ ++ centered = 1; + else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */ + fstrncmp = strncasecmp; + fstrstr = cistrstr; +-- +2.24.1 +