diff options
author | Connor Lane Smith <cls@lubutu.com> | 2011-05-08 15:15:24 +0100 |
---|---|---|
committer | Connor Lane Smith <cls@lubutu.com> | 2011-05-08 15:15:24 +0100 |
commit | e0e6b071c63f960c398b43b2fbf0dec66a9b3ab6 (patch) | |
tree | 5a1d4affa4cfc85402f9e2c8fcbdbbecffb6b259 /dmenu.c | |
parent | cd3b4915c3358b93f8dbff531bff82c0cd833c0b (diff) |
fast grab patch (thanks Rob)
Diffstat (limited to 'dmenu.c')
-rw-r--r-- | dmenu.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -64,6 +64,7 @@ static int (*fstrncmp)(const char *, const char *, size_t) = strncmp; int main(int argc, char *argv[]) { + Bool fast = False; int i; progname = "dmenu"; @@ -77,6 +78,8 @@ main(int argc, char *argv[]) { topbar = False; else if(!strcmp(argv[i], "-i")) fstrncmp = strncasecmp; + else if(!strcmp(argv[i], "-f")) + fast = True; else if(i == argc-1) goto usage; /* double flags */ @@ -101,13 +104,21 @@ main(int argc, char *argv[]) { dc = initdc(); initfont(dc, font); - readstdin(); - setup(); + + if(fast) { + setup(); + readstdin(); + } + else { + readstdin(); + setup(); + } + match(); run(); return EXIT_FAILURE; usage: - fputs("usage: dmenu [-b] [-i] [-l lines] [-m monitor] [-p prompt] [-fn font]\n" + fputs("usage: dmenu [-b] [-f] [-i] [-l lines] [-m monitor] [-p prompt] [-fn font]\n" " [-nb color] [-nf color] [-sb color] [-sf color] [-v]\n", stderr); return EXIT_FAILURE; } @@ -530,5 +541,4 @@ setup(void) { inputw = MIN(inputw, mw/3); promptw = prompt ? textw(dc, prompt) : 0; XMapRaised(dc->dpy, win); - match(); } |