aboutsummaryrefslogtreecommitdiffstats
path: root/patches/dmenu-initialtext-4.7.diff
diff options
context:
space:
mode:
authorNikita Langer <nikitalanger@icloud.com>2026-07-12 15:24:59 +0200
committerNikita Langer <nikitalanger@icloud.com>2026-07-12 15:24:59 +0200
commit8868deb87284b60a7b75dfdc1da6120b7c2820c2 (patch)
tree43e46b4a3f62394f159da32217f9d67f89e11adf /patches/dmenu-initialtext-4.7.diff
parent7175c4880bac3d2a2d4a6262b59193f0a38e2fdb (diff)
downloaddmenu-8868deb87284b60a7b75dfdc1da6120b7c2820c2.tar.gz
dmenu-8868deb87284b60a7b75dfdc1da6120b7c2820c2.tar.bz2
dmenu-8868deb87284b60a7b75dfdc1da6120b7c2820c2.tar.xz
dmenu-8868deb87284b60a7b75dfdc1da6120b7c2820c2.zip
xrdb
Diffstat (limited to 'patches/dmenu-initialtext-4.7.diff')
-rw-r--r--patches/dmenu-initialtext-4.7.diff49
1 files changed, 49 insertions, 0 deletions
diff --git a/patches/dmenu-initialtext-4.7.diff b/patches/dmenu-initialtext-4.7.diff
new file mode 100644
index 0000000..3d84708
--- /dev/null
+++ b/patches/dmenu-initialtext-4.7.diff
@@ -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())