nah nah nah, I can't get used to the bottom bar, pushing the conditional dmenu again
3ba8b71a
2 file(s) · +11 −3
| 3 | 3 | dmenu \- dynamic menu |
|
| 4 | 4 | .SH SYNOPSIS |
|
| 5 | 5 | .B dmenu |
|
| 6 | + | .RB [ \-b ] |
|
| 6 | 7 | .RB [ \-fn " <font>"] |
|
| 7 | 8 | .RB [ \-nb " <color>"] |
|
| 8 | 9 | .RB [ \-nf " <color>"] |
|
| 18 | 19 | It manages huge amounts (up to 10.000 and more) of user defined menu items |
|
| 19 | 20 | efficiently. |
|
| 20 | 21 | .SS Options |
|
| 22 | + | .TP |
|
| 23 | + | .B \-b |
|
| 24 | + | makes dmenu appear at the screen bottom (by default it appears at the screen top). |
|
| 21 | 25 | .TP |
|
| 22 | 26 | .B \-fn <font> |
|
| 23 | 27 | defines the font. |
|
| 342 | 342 | ||
| 343 | 343 | int |
|
| 344 | 344 | main(int argc, char *argv[]) { |
|
| 345 | + | Bool bottom = False; |
|
| 345 | 346 | char *font = FONT; |
|
| 346 | 347 | char *maxname; |
|
| 347 | 348 | char *normbg = NORMBGCOLOR; |
|
| 360 | 361 | timeout.tv_sec = 3; |
|
| 361 | 362 | /* command line args */ |
|
| 362 | 363 | for(i = 1; i < argc; i++) |
|
| 363 | - | if(!strncmp(argv[i], "-fn", 4)) { |
|
| 364 | + | if(!strncmp(argv[i], "-b", 3)) { |
|
| 365 | + | bottom = True; |
|
| 366 | + | } |
|
| 367 | + | else if(!strncmp(argv[i], "-fn", 4)) { |
|
| 364 | 368 | if(++i < argc) font = argv[i]; |
|
| 365 | 369 | } |
|
| 366 | 370 | else if(!strncmp(argv[i], "-nb", 4)) { |
|
| 386 | 390 | exit(EXIT_SUCCESS); |
|
| 387 | 391 | } |
|
| 388 | 392 | else |
|
| 389 | - | eprint("usage: dmenu [-fn <font>] [-nb <color>] [-nf <color>] [-p <prompt>]\n" |
|
| 393 | + | eprint("usage: dmenu [-b] [-fn <font>] [-nb <color>] [-nf <color>] [-p <prompt>]\n" |
|
| 390 | 394 | " [-sb <color>] [-sf <color>] [-t <seconds>] [-v]\n", stdout); |
|
| 391 | 395 | setlocale(LC_CTYPE, ""); |
|
| 392 | 396 | dpy = XOpenDisplay(0); |
|
| 430 | 434 | mw = DisplayWidth(dpy, screen); |
|
| 431 | 435 | mh = dc.font.height + 2; |
|
| 432 | 436 | win = XCreateWindow(dpy, root, 0, |
|
| 433 | - | DisplayHeight(dpy, screen) - mh, mw, mh, 0, |
|
| 437 | + | bottom ? DisplayHeight(dpy, screen) - mh : 0, mw, mh, 0, |
|
| 434 | 438 | DefaultDepth(dpy, screen), CopyFromParent, |
|
| 435 | 439 | DefaultVisual(dpy, screen), |
|
| 436 | 440 | CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); |
|