diff -r 545ec6141dc4 dmenu.1 --- a/dmenu.1 Wed May 05 11:42:39 2010 +0100 +++ b/dmenu.1 Wed May 05 21:04:44 2010 +0200 @@ -5,6 +5,7 @@ .B dmenu .RB [ \-i ] .RB [ \-b ] +.RB [ \-r ] .RB [ \-l " "] .RB [ \-fn " "] .RB [ \-nb " "] @@ -27,6 +28,9 @@ .B \-b defines that dmenu appears at the bottom. .TP +.B \-r +incrementally print text on standard output as it is entered. +.TP .B \-l activates vertical list mode. The given number of lines will be displayed. Window height will get adjusted. diff -r 545ec6141dc4 dmenu.c --- a/dmenu.c Wed May 05 11:42:39 2010 +0100 +++ b/dmenu.c Wed May 05 21:04:44 2010 +0200 @@ -80,6 +80,7 @@ static int ret = 0; static int cursor = 0; static int screen; +static int incremental; static unsigned int mw, mh; static unsigned int numlockmask = 0; static Bool running = True; @@ -574,6 +575,10 @@ if(!pattern) return; + if (incremental) { + fprintf(stdout, "%s\n", text); + fflush(stdout); + } plen = strlen(pattern); item = lexact = lprefix = lsubstr = itemend = exactend = prefixend = substrend = NULL; for(i = allitems; i; i = i->next) @@ -770,6 +775,9 @@ } else if(!strcmp(argv[i], "-b")) topbar = False; + else if(!strcmp(argv[i], "-r")) { + incremental = 1; + } else if(!strcmp(argv[i], "-e")) { if(++i < argc) parent = atoi(argv[i]); } @@ -798,7 +806,7 @@ else if(!strcmp(argv[i], "-v")) eprint("dmenu-"VERSION", © 2006-2010 dmenu engineers, see LICENSE for details\n"); else - eprint("usage: dmenu [-i] [-b] [-e ] [-l ] [-fn ] [-nb ]\n" + eprint("usage: dmenu [-i] [-b] [-r] [-e ] [-l ] [-fn ] [-nb ]\n" " [-nf ] [-p ] [-sb ] [-sf ] [-v]\n"); if(!setlocale(LC_CTYPE, "") || !XSupportsLocale()) fprintf(stderr, "warning: no locale support\n");