prepared dmenu-1.8, shortened command line options (-font is -fn, -selbg is -sb, -selfg is -sf, -normbg is -nb, -normfg is -nf now)

master
arg@mig29 18 years ago
parent 989649b5a5
commit 0e96ae6f48
  1. 30
      dmenu.1
  2. 22
      main.c

@ -3,13 +3,13 @@
dmenu \- dynamic menu dmenu \- dynamic menu
.SH SYNOPSIS .SH SYNOPSIS
.B dmenu .B dmenu
.RB [ \-bottom ] .RB [ \-b ]
.RB [ \-font " <name>"] .RB [ \-fn " <font>"]
.RB [ \-normbg " <color>"] .RB [ \-nb " <color>"]
.RB [ \-normfg " <color>"] .RB [ \-nf " <color>"]
.RB [ \-selbg " <color>"]
.RB [ \-selfg " <color>"]
.RB [ \-p " <prompt>"] .RB [ \-p " <prompt>"]
.RB [ \-sb " <color>"]
.RB [ \-sf " <color>"]
.RB [ \-t " <seconds>"] .RB [ \-t " <seconds>"]
.RB [ \-v ] .RB [ \-v ]
.SH DESCRIPTION .SH DESCRIPTION
@ -20,27 +20,27 @@ It manages huge amounts (up to 10.000 and more) of user defined menu items
efficiently. efficiently.
.SS Options .SS Options
.TP .TP
.B \-bottom .B \-b
makes dmenu appear at the screen bottom (by default it appears at the screen top). makes dmenu appear at the screen bottom (by default it appears at the screen top).
.TP .TP
.B \-font <name> .B \-font <font>
defines the font. defines the font.
.TP .TP
.B \-normbg <color> .B \-nb <color>
defines the normal background color (#RGB, #RRGGBB, and color names are supported). defines the normal background color (#RGB, #RRGGBB, and color names are supported).
.TP .TP
.B \-normfg <color> .B \-nf <color>
defines the normal foreground color (#RGB, #RRGGBB, and color names are supported). defines the normal foreground color (#RGB, #RRGGBB, and color names are supported).
.TP .TP
.B \-selbg <color> .B \-p <prompt>
defines a prompt to be displayed before the input area.
.TP
.B \-sb <color>
defines the selected background color (#RGB, #RRGGBB, and color names are supported). defines the selected background color (#RGB, #RRGGBB, and color names are supported).
.TP .TP
.B \-selfg <color> .B \-sf <color>
defines the selected foreground color (#RGB, #RRGGBB, and color names are supported). defines the selected foreground color (#RGB, #RRGGBB, and color names are supported).
.TP .TP
.B \-p <prompt>
defines a prompt to be displayed before the input area.
.TP
.B \-t <seconds> .B \-t <seconds>
defines the seconds to wait for standard input, before exiting (default is 3). defines the seconds to wait for standard input, before exiting (default is 3).
.TP .TP

@ -348,27 +348,27 @@ 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], "-bottom", 8)) { if(!strncmp(argv[i], "-b", 3)) {
bottom = True; bottom = True;
} }
else if(!strncmp(argv[i], "-font", 6)) { else if(!strncmp(argv[i], "-fn", 4)) {
if(++i < argc) font = argv[i]; if(++i < argc) font = argv[i];
} }
else if(!strncmp(argv[i], "-normbg", 8)) { else if(!strncmp(argv[i], "-nb", 4)) {
if(++i < argc) normbg = argv[i]; if(++i < argc) normbg = argv[i];
} }
else if(!strncmp(argv[i], "-normfg", 8)) { else if(!strncmp(argv[i], "-nf", 4)) {
if(++i < argc) normfg = argv[i]; if(++i < argc) normfg = argv[i];
} }
else if(!strncmp(argv[i], "-selbg", 7)) { else if(!strncmp(argv[i], "-p", 3)) {
if(++i < argc) prompt = argv[i];
}
else if(!strncmp(argv[i], "-sb", 4)) {
if(++i < argc) selbg = argv[i]; if(++i < argc) selbg = argv[i];
} }
else if(!strncmp(argv[i], "-selfg", 7)) { else if(!strncmp(argv[i], "-sf", 4)) {
if(++i < argc) selfg = argv[i]; if(++i < argc) selfg = argv[i];
} }
else if(!strncmp(argv[i], "-p", 3)) {
if(++i < argc) prompt = argv[i];
}
else if(!strncmp(argv[i], "-t", 3)) { else if(!strncmp(argv[i], "-t", 3)) {
if(++i < argc) timeout.tv_sec = atoi(argv[i]); if(++i < argc) timeout.tv_sec = atoi(argv[i]);
} }
@ -377,8 +377,8 @@ main(int argc, char *argv[]) {
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
else else
eprint("usage: dmenu [-bottom] [-font <name>] [-{norm,sel}{bg,fg} <color>]\n" eprint("usage: dmenu [-b] [-fn <font>] [-nb <color>] [-nf <color>] [-p <prompt>]\n"
" [-p <prompt>] [-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);
if(!dpy) if(!dpy)

Loading…
Cancel
Save