- if(argc == 2 && !strncmp("-v", argv[1], 3)) {
- fputs("dmenu-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout);
- exit(EXIT_SUCCESS);
- }
- else if(argc != 1)
- eprint("usage: dmenu [-v]\n");
-
+ timeout.tv_usec = 0;
+ timeout.tv_sec = 3;
+ /* command line args */
+ for(i = 1; i < argc; i++)
+ if(!strncmp(argv[i], "-font", 6))
+ font = argv[++i];
+ else if(!strncmp(argv[i], "-normbg", 8))
+ normbg = argv[++i];
+ else if(!strncmp(argv[i], "-normfg", 8))
+ normfg = argv[++i];
+ else if(!strncmp(argv[i], "-selbg", 7))
+ selbg = argv[++i];
+ else if(!strncmp(argv[i], "-selfg", 7))
+ selfg = argv[++i];
+ else if(!strncmp(argv[i], "-t", 3))
+ timeout.tv_sec = atoi(argv[++i]);
+ else if(!strncmp(argv[i], "-v", 3)) {
+ fputs("dmenu-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout);
+ exit(EXIT_SUCCESS);
+ }
+ else
+ eprint("usage: dmenu [-font <name>] [-{norm,sel}{bg,fg} <color>] [-t <seconds>] [-v]\n", stdout);