diff -r 7057efb48ef3 dmenu.c --- a/dmenu.c Tue Nov 02 12:15:15 2010 +0000 +++ b/dmenu.c Thu Nov 11 19:33:34 2010 -0800 @@ -55,6 +55,7 @@ static unsigned long selcol[ColLast]; static Atom utf8; static Bool topbar = True; +static Bool argtext = False; static DC *dc; static Item *items = NULL; static Item *matches, *sel; @@ -485,7 +486,8 @@ inputw = MIN(inputw, mw/3); promptw = prompt ? dc_textw(dc, prompt) : 0; XMapRaised(dc->dpy, win); - text[0] = '\0'; + if (!argtext) + text[0] = '\0'; match(); } @@ -530,7 +532,11 @@ selbgcolor = argv[++i]; else if(!strcmp(argv[i], "-sf")) selfgcolor = argv[++i]; - else + else if(!strcmp(argv[i], "-t")) { + strncpy(text, argv[++i], sizeof text); + cursor = strlen(text); + argtext = True; + } else usage(); dc = dc_init();