From 3ba8b71abafdd52adaf8c2d4bfa56dc9023c865e Mon Sep 17 00:00:00 2001 From: Anselm R. Garbe Date: Thu, 8 Feb 2007 11:17:11 +0100 Subject: nah nah nah, I can't get used to the bottom bar, pushing the conditional dmenu again --- main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 224d298..f1f71fd 100644 --- a/main.c +++ b/main.c @@ -342,6 +342,7 @@ DC dc = {0}; int main(int argc, char *argv[]) { + Bool bottom = False; char *font = FONT; char *maxname; char *normbg = NORMBGCOLOR; @@ -360,7 +361,10 @@ main(int argc, char *argv[]) { timeout.tv_sec = 3; /* command line args */ for(i = 1; i < argc; i++) - if(!strncmp(argv[i], "-fn", 4)) { + if(!strncmp(argv[i], "-b", 3)) { + bottom = True; + } + else if(!strncmp(argv[i], "-fn", 4)) { if(++i < argc) font = argv[i]; } else if(!strncmp(argv[i], "-nb", 4)) { @@ -386,7 +390,7 @@ main(int argc, char *argv[]) { exit(EXIT_SUCCESS); } else - eprint("usage: dmenu [-fn ] [-nb ] [-nf ] [-p ]\n" + eprint("usage: dmenu [-b] [-fn ] [-nb ] [-nf ] [-p ]\n" " [-sb ] [-sf ] [-t ] [-v]\n", stdout); setlocale(LC_CTYPE, ""); dpy = XOpenDisplay(0); @@ -430,7 +434,7 @@ main(int argc, char *argv[]) { mw = DisplayWidth(dpy, screen); mh = dc.font.height + 2; win = XCreateWindow(dpy, root, 0, - DisplayHeight(dpy, screen) - mh, mw, mh, 0, + bottom ? DisplayHeight(dpy, screen) - mh : 0, mw, mh, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); -- cgit v1.2.3