diff options
author | Saumit Dinesan <79687674+justsaumit@users.noreply.github.com> | 2022-01-27 22:13:50 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 22:13:50 +0530 |
commit | a4cd52a47d182c46e967f022c42d3a9aa89dc205 (patch) | |
tree | bc37a6a9af66e474f35e590135b3f924d2c05ef7 /patches/4.dmenu-instant-4.7.diff | |
parent | 93d674df44c4d0057efdd96a14cd5546f3f97e54 (diff) |
Delete patches directory
Diffstat (limited to 'patches/4.dmenu-instant-4.7.diff')
-rw-r--r-- | patches/4.dmenu-instant-4.7.diff | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/patches/4.dmenu-instant-4.7.diff b/patches/4.dmenu-instant-4.7.diff deleted file mode 100644 index a78276f..0000000 --- a/patches/4.dmenu-instant-4.7.diff +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index 1edb647..37f43d5 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -1,6 +1,7 @@ - /* See LICENSE file for copyright and license details. */ - /* Default settings; can be overriden by command line. */ - -+static int instant = 0; - 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[] = { -diff --git a/dmenu.1 b/dmenu.1 -index 9eab758..98d3725 100644 ---- a/dmenu.1 -+++ b/dmenu.1 -@@ -3,7 +3,7 @@ - dmenu \- dynamic menu - .SH SYNOPSIS - .B dmenu --.RB [ \-bfiv ] -+.RB [ \-bfinv ] - .RB [ \-l - .IR lines ] - .RB [ \-m -@@ -47,6 +47,9 @@ X until stdin reaches end\-of\-file. - .B \-i - dmenu matches menu items case insensitively. - .TP -+.B \-n -+dmenu instantly selects if only one match. -+.TP - .BI \-l " lines" - dmenu lists items vertically, with the given number of lines. - .TP -diff --git a/dmenu.c b/dmenu.c -index d605ab4..2c2f03e 100644 ---- a/dmenu.c -+++ b/dmenu.c -@@ -260,6 +260,13 @@ match(void) - matchend = substrend; - } - curr = sel = matches; -+ -+ if(instant && matches && matches==matchend && !lsubstr) { -+ puts(matches->text); -+ cleanup(); -+ exit(0); -+ } -+ - calcoffsets(); - } - -@@ -636,7 +643,7 @@ setup(void) - static void - usage(void) - { -- fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n" -+ fputs("usage: dmenu [-bfinv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n" - " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr); - exit(1); - } -@@ -659,7 +666,9 @@ main(int argc, char *argv[]) - else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */ - fstrncmp = strncasecmp; - fstrstr = cistrstr; -- } else if (i + 1 == argc) -+ } else if (!strcmp(argv[i], "-n")) /* instant select only match */ -+ instant = 1; -+ else if (i + 1 == argc) - usage(); - /* these options take one argument */ - else if (!strcmp(argv[i], "-l")) /* number of lines in vertical list */ |