diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-02-08 11:10:29 +0100 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-08 11:10:29 +0100 |
| commit | 2bac5599b3e7629875d692b65a336915ecfee49d (patch) | |
| tree | b0734655eb2de1fe1f6b852727e2b85a14ecabfa | |
| parent | dbccf6fbff01dce1e4349ab8ccff4357e360da4c (diff) | |
letting dmenu appear at the bottom by default
| -rw-r--r-- | dmenu.1 | 4 | ||||
| -rw-r--r-- | main.c | 10 |
2 files changed, 3 insertions, 11 deletions
| @@ -3,7 +3,6 @@ | |||
| 3 | dmenu \- dynamic menu | 3 | dmenu \- dynamic menu |
| 4 | .SH SYNOPSIS | 4 | .SH SYNOPSIS |
| 5 | .B dmenu | 5 | .B dmenu |
| 6 | .RB [ \-b ] | ||
| 7 | .RB [ \-fn " <font>"] | 6 | .RB [ \-fn " <font>"] |
| 8 | .RB [ \-nb " <color>"] | 7 | .RB [ \-nb " <color>"] |
| 9 | .RB [ \-nf " <color>"] | 8 | .RB [ \-nf " <color>"] |
| @@ -20,9 +19,6 @@ It manages huge amounts (up to 10.000 and more) of user defined menu items | |||
| 20 | efficiently. | 19 | efficiently. |
| 21 | .SS Options | 20 | .SS Options |
| 22 | .TP | 21 | .TP |
| 23 | .B \-b | ||
| 24 | makes dmenu appear at the screen bottom (by default it appears at the screen top). | ||
| 25 | .TP | ||
| 26 | .B \-fn <font> | 22 | .B \-fn <font> |
| 27 | defines the font. | 23 | defines the font. |
| 28 | .TP | 24 | .TP |
| @@ -342,7 +342,6 @@ DC dc = {0}; | |||
| 342 | 342 | ||
| 343 | int | 343 | int |
| 344 | main(int argc, char *argv[]) { | 344 | main(int argc, char *argv[]) { |
| 345 | Bool bottom = False; | ||
| 346 | char *font = FONT; | 345 | char *font = FONT; |
| 347 | char *maxname; | 346 | char *maxname; |
| 348 | char *normbg = NORMBGCOLOR; | 347 | char *normbg = NORMBGCOLOR; |
| @@ -361,10 +360,7 @@ main(int argc, char *argv[]) { | |||
| 361 | timeout.tv_sec = 3; | 360 | timeout.tv_sec = 3; |
| 362 | /* command line args */ | 361 | /* command line args */ |
| 363 | for(i = 1; i < argc; i++) | 362 | for(i = 1; i < argc; i++) |
| 364 | if(!strncmp(argv[i], "-b", 3)) { | 363 | if(!strncmp(argv[i], "-fn", 4)) { |
| 365 | bottom = True; | ||
| 366 | } | ||
| 367 | else if(!strncmp(argv[i], "-fn", 4)) { | ||
| 368 | if(++i < argc) font = argv[i]; | 364 | if(++i < argc) font = argv[i]; |
| 369 | } | 365 | } |
| 370 | else if(!strncmp(argv[i], "-nb", 4)) { | 366 | else if(!strncmp(argv[i], "-nb", 4)) { |
| @@ -390,7 +386,7 @@ main(int argc, char *argv[]) { | |||
| 390 | exit(EXIT_SUCCESS); | 386 | exit(EXIT_SUCCESS); |
| 391 | } | 387 | } |
| 392 | else | 388 | else |
| 393 | eprint("usage: dmenu [-b] [-fn <font>] [-nb <color>] [-nf <color>] [-p <prompt>]\n" | 389 | eprint("usage: dmenu [-fn <font>] [-nb <color>] [-nf <color>] [-p <prompt>]\n" |
| 394 | " [-sb <color>] [-sf <color>] [-t <seconds>] [-v]\n", stdout); | 390 | " [-sb <color>] [-sf <color>] [-t <seconds>] [-v]\n", stdout); |
| 395 | setlocale(LC_CTYPE, ""); | 391 | setlocale(LC_CTYPE, ""); |
| 396 | dpy = XOpenDisplay(0); | 392 | dpy = XOpenDisplay(0); |
| @@ -434,7 +430,7 @@ main(int argc, char *argv[]) { | |||
| 434 | mw = DisplayWidth(dpy, screen); | 430 | mw = DisplayWidth(dpy, screen); |
| 435 | mh = dc.font.height + 2; | 431 | mh = dc.font.height + 2; |
| 436 | win = XCreateWindow(dpy, root, 0, | 432 | win = XCreateWindow(dpy, root, 0, |
| 437 | bottom ? DisplayHeight(dpy, screen) - mh : 0, mw, mh, 0, | 433 | DisplayHeight(dpy, screen) - mh, mw, mh, 0, |
| 438 | DefaultDepth(dpy, screen), CopyFromParent, | 434 | DefaultDepth(dpy, screen), CopyFromParent, |
| 439 | DefaultVisual(dpy, screen), | 435 | DefaultVisual(dpy, screen), |
| 440 | CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); | 436 | CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); |
