diff options
| author | stkhan <personal@slickd.xyz> | 2025-07-24 19:02:41 -0500 |
|---|---|---|
| committer | stkhan <personal@slickd.xyz> | 2025-07-24 19:02:41 -0500 |
| commit | 1d431d19b17b8bf362b323918f3c906ee858343f (patch) | |
| tree | 9d484920fde94c2ab4a8ccd524811cba6fe608a7 /wm/dmenu-5.3/dmenu.c | |
| parent | c6ed3de8a62fc3a8eae866eaa7ac076b28d88ad7 (diff) | |
Clean
Diffstat (limited to 'wm/dmenu-5.3/dmenu.c')
| -rw-r--r-- | wm/dmenu-5.3/dmenu.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/wm/dmenu-5.3/dmenu.c b/wm/dmenu-5.3/dmenu.c index 504487c..8ce8aac 100644 --- a/wm/dmenu-5.3/dmenu.c +++ b/wm/dmenu-5.3/dmenu.c @@ -306,6 +306,13 @@ match(void) matchend = substrend; } curr = sel = matches; + + if (instant && matches && matches==matchend && !lsubstr) { + puts(matches->text); + cleanup(); + exit(0); + } + calcoffsets(); } @@ -789,7 +796,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], "-g")) { /* number of columns in grid */ |