|
|
@ -342,6 +342,7 @@ DC dc = {0}; |
|
|
|
|
|
|
|
|
|
|
|
int |
|
|
|
int |
|
|
|
main(int argc, char *argv[]) { |
|
|
|
main(int argc, char *argv[]) { |
|
|
|
|
|
|
|
Bool bottom = False; |
|
|
|
char *font = FONT; |
|
|
|
char *font = FONT; |
|
|
|
char *maxname; |
|
|
|
char *maxname; |
|
|
|
char *normbg = NORMBGCOLOR; |
|
|
|
char *normbg = NORMBGCOLOR; |
|
|
@ -360,7 +361,10 @@ main(int argc, char *argv[]) { |
|
|
|
timeout.tv_sec = 3; |
|
|
|
timeout.tv_sec = 3; |
|
|
|
/* command line args */ |
|
|
|
/* command line args */ |
|
|
|
for(i = 1; i < argc; i++) |
|
|
|
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]; |
|
|
|
if(++i < argc) font = argv[i]; |
|
|
|
} |
|
|
|
} |
|
|
|
else if(!strncmp(argv[i], "-nb", 4)) { |
|
|
|
else if(!strncmp(argv[i], "-nb", 4)) { |
|
|
@ -386,7 +390,7 @@ main(int argc, char *argv[]) { |
|
|
|
exit(EXIT_SUCCESS); |
|
|
|
exit(EXIT_SUCCESS); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
eprint("usage: dmenu [-fn <font>] [-nb <color>] [-nf <color>] [-p <prompt>]\n" |
|
|
|
eprint("usage: dmenu [-b] [-fn <font>] [-nb <color>] [-nf <color>] [-p <prompt>]\n" |
|
|
|
" [-sb <color>] [-sf <color>] [-t <seconds>] [-v]\n", stdout); |
|
|
|
" [-sb <color>] [-sf <color>] [-t <seconds>] [-v]\n", stdout); |
|
|
|
setlocale(LC_CTYPE, ""); |
|
|
|
setlocale(LC_CTYPE, ""); |
|
|
|
dpy = XOpenDisplay(0); |
|
|
|
dpy = XOpenDisplay(0); |
|
|
@ -430,7 +434,7 @@ main(int argc, char *argv[]) { |
|
|
|
mw = DisplayWidth(dpy, screen); |
|
|
|
mw = DisplayWidth(dpy, screen); |
|
|
|
mh = dc.font.height + 2; |
|
|
|
mh = dc.font.height + 2; |
|
|
|
win = XCreateWindow(dpy, root, 0, |
|
|
|
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, |
|
|
|
DefaultDepth(dpy, screen), CopyFromParent, |
|
|
|
DefaultVisual(dpy, screen), |
|
|
|
DefaultVisual(dpy, screen), |
|
|
|
CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); |
|
|
|
CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); |
|
|
|