static int mx, my, mw, mh;
static int ret = 0;
static int nitem = 0;
static unsigned int cmdw = 0;
static int mx, my, mw, mh;
static int ret = 0;
static int nitem = 0;
static unsigned int cmdw = 0;
static Item *allitems = NULL; /* first of all items */
static Item *item = NULL; /* first of pattern matching items */
static Item *sel = NULL;
static Item *allitems = NULL; /* first of all items */
static Item *item = NULL; /* first of pattern matching items */
static Item *sel = NULL;
}
XCopyArea(dpy, dc.drawable, win, dc.gc, 0, 0, mw, mh, 0, 0);
XFlush(dpy);
}
static void
}
XCopyArea(dpy, dc.drawable, win, dc.gc, 0, 0, mw, mh, 0, 0);
XFlush(dpy);
}
static void
strncat(text, buf, sizeof(text));
else
strncpy(text, buf, sizeof(text));
strncat(text, buf, sizeof(text));
else
strncpy(text, buf, sizeof(text));
- /* command line args */
- for(i = 1; i < argc; i++) {
- if (argv[i][0] == '-')
- switch (argv[i][1]) {
- case 'v':
- fputs("dmenu-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout);
- exit(EXIT_SUCCESS);
- break;
- case 't':
- if(++i < argc) {
- title = argv[i];
- break;
- }
- default:
- eprint("usage: dmenu [-v] [-t <title>]\n");
- break;
- }
- else
- eprint("usage: dmenu [-v] [-t <title>]\n");
+ if(argc == 2 && !strncmp("-v", argv[1], 3)) {
+ fputs("dmenu-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout);
+ exit(EXIT_SUCCESS);
screen = DefaultScreen(dpy);
root = RootWindow(dpy, screen);
screen = DefaultScreen(dpy);
root = RootWindow(dpy, screen);
/* grab as early as possible, but after reading all items!!! */
while(XGrabKeyboard(dpy, root, True, GrabModeAsync,
/* grab as early as possible, but after reading all items!!! */
while(XGrabKeyboard(dpy, root, True, GrabModeAsync,
- dc.bg = getcolor(BGCOLOR);
- dc.fg = getcolor(FGCOLOR);
- dc.border = getcolor(BORDERCOLOR);
+ dc.sel[ColBG] = getcolor(SELBGCOLOR);
+ dc.sel[ColFG] = getcolor(SELFGCOLOR);
+ dc.norm[ColBG] = getcolor(NORMBGCOLOR);
+ dc.norm[ColFG] = getcolor(NORMFGCOLOR);
win = XCreateWindow(dpy, root, mx, my, mw, mh, 0,
DefaultDepth(dpy, screen), CopyFromParent,
win = XCreateWindow(dpy, root, mx, my, mw, mh, 0,
DefaultDepth(dpy, screen), CopyFromParent,
/* pixmap */
dc.drawable = XCreatePixmap(dpy, root, mw, mh, DefaultDepth(dpy, screen));
dc.gc = XCreateGC(dpy, root, 0, 0);
/* pixmap */
dc.drawable = XCreatePixmap(dpy, root, mw, mh, DefaultDepth(dpy, screen));
dc.gc = XCreateGC(dpy, root, 0, 0);
XFreePixmap(dpy, dc.drawable);
XFreeGC(dpy, dc.gc);
XDestroyWindow(dpy, win);
XFreePixmap(dpy, dc.drawable);
XFreeGC(dpy, dc.gc);
XDestroyWindow(dpy, win);