Return to repo list

suckless-gf-dmenu

Gentoo-friendly patches for Suckless's dmenu.
Return to HMagellan.com

commit c262ad8b2bd5f11b080b661053f247090064e4b7
parent 2f0656e7ca6bc8475183680e8e6713d8d3786d59
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Thu, 20 Aug 2020 14:26:22 -0500

Added initialtext

Diffstat:
Apatches/initialtext/USAGE | 20++++++++++++++++++++
Apatches/initialtext/initialtext.patch | 49+++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/patches/initialtext/USAGE b/patches/initialtext/USAGE @@ -0,0 +1,20 @@ +initialtext - Start dmenu with some text already entered +Source: https://tools.suckless.org/dmenu/patches/initialtext/dmenu-initialtext-4.7.diff +Original Author: Michael Stummvoll (stummi)suckless@stummi.org + +Description from source: + """ + Adds an option to provide preselected text. + """ + +== YOU MUST == +(1). Place the patch file in /etc/portage/patches/x11-misc/dmenu/ and run 'emerge dmenu' + +== YOU PROBABLY SHOULD == +(1). Run dmenu with the '-it X' option, where 'X' is the text you want dmenu to start with + +== PATCH MODIFICATIONS == +No modifications were made to this patch. + +== INCOMPATIBILITIES == +No known specific incompatibilities. diff --git a/patches/initialtext/initialtext.patch b/patches/initialtext/initialtext.patch @@ -0,0 +1,49 @@ +diff --git a/dmenu.1 b/dmenu.1 +index 9eab758..b4947f9 100644 +--- a/dmenu.1 ++++ b/dmenu.1 +@@ -22,6 +22,8 @@ dmenu \- dynamic menu + .IR color ] + .RB [ \-w + .IR windowid ] ++.RB [ \-it ++.IR text ] + .P + .BR dmenu_run " ..." + .SH DESCRIPTION +@@ -80,6 +82,9 @@ prints version information to stdout, then exits. + .TP + .BI \-w " windowid" + embed into windowid. ++.TP ++.BI \-it " text". ++start with initial text input. + .SH USAGE + dmenu is completely controlled by the keyboard. Items are selected using the + arrow keys, page up, page down, home, and end. +diff --git a/dmenu.c b/dmenu.c +index d605ab4..0564dfe 100644 +--- a/dmenu.c ++++ b/dmenu.c +@@ -637,7 +637,8 @@ static void + usage(void) + { + fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n" +- " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr); ++ " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n" ++ " [-it text]\n", stderr); + exit(1); + } + +@@ -680,7 +681,10 @@ main(int argc, char *argv[]) + colors[SchemeSel][ColFg] = argv[++i]; + else if (!strcmp(argv[i], "-w")) /* embedding window id */ + embed = argv[++i]; +- else ++ else if (!strcmp(argv[i], "-it")) { /* embedding window id */ ++ const char * text = argv[++i]; ++ insert(text, strlen(text)); ++ } else + usage(); + + if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())