.RB [ \-f ]
.RB [ \-i ]
.RB [ \-l
.RB [ \-f ]
.RB [ \-i ]
.RB [ \-l
+.RB [ \-m
+.IR monitor ]
.IR lines ]
.RB [ \-p
.IR prompt ]
.IR lines ]
.RB [ \-p
.IR prompt ]
.BI \-l " lines"
dmenu lists items vertically, with the given number of lines.
.TP
.BI \-l " lines"
dmenu lists items vertically, with the given number of lines.
.TP
+.BI \-m " monitor"
+dmenu is displayed on the monitor supplied.
+.TP
.BI \-p " prompt"
defines the prompt to be displayed to the left of the input field.
.TP
.BI \-p " prompt"
defines the prompt to be displayed to the left of the input field.
.TP
static Item *prev, *curr, *next, *sel;
static Window win;
static XIC xic;
static Item *prev, *curr, *next, *sel;
static Window win;
static XIC xic;
/* these options take one argument */
else if(!strcmp(argv[i], "-l")) /* number of lines in vertical list */
lines = atoi(argv[++i]);
/* these options take one argument */
else if(!strcmp(argv[i], "-l")) /* number of lines in vertical list */
lines = atoi(argv[++i]);
+ else if(!strcmp(argv[i], "-m"))
+ mon = atoi(argv[++i]);
else if(!strcmp(argv[i], "-p")) /* adds prompt to left of input field */
prompt = argv[++i];
else if(!strcmp(argv[i], "-fn")) /* font or font set */
else if(!strcmp(argv[i], "-p")) /* adds prompt to left of input field */
prompt = argv[++i];
else if(!strcmp(argv[i], "-fn")) /* font or font set */
XWindowAttributes wa;
XGetInputFocus(dc->dpy, &w, &di);
XWindowAttributes wa;
XGetInputFocus(dc->dpy, &w, &di);
- if(w != root && w != PointerRoot && w != None) {
+ if(mon != -1 && mon < n)
+ i = mon;
+ if(!i && w != root && w != PointerRoot && w != None) {
/* find top-level window containing current input focus */
do {
if(XQueryTree(dc->dpy, (pw = w), &dw, &w, &dws, &du) && dws)
/* find top-level window containing current input focus */
do {
if(XQueryTree(dc->dpy, (pw = w), &dw, &w, &dws, &du) && dws)
}
}
/* no focused window is on screen, so use pointer location instead */
}
}
/* no focused window is on screen, so use pointer location instead */
- if(!area && XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du))
+ if(mon == -1 && !area && XQueryPointer(dc->dpy, root, &dw, &dw, &x, &y, &di, &di, &du))
for(i = 0; i < n; i++)
if(INTERSECT(x, y, 1, 1, info[i]))
break;
for(i = 0; i < n; i++)
if(INTERSECT(x, y, 1, 1, info[i]))
break;
- fputs("usage: dmenu [-b] [-f] [-i] [-l lines] [-p prompt] [-fn font]\n"
+ fputs("usage: dmenu [-b] [-f] [-i] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
" [-nb color] [-nf color] [-sb color] [-sf color] [-v]\n", stderr);
exit(EXIT_FAILURE);
}
" [-nb color] [-nf color] [-sb color] [-sf color] [-v]\n", stderr);
exit(EXIT_FAILURE);
}