Xinqi Bao's Git
projects
/
dmenu.git
/ diff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
2bac559
)
nah nah nah, I can't get used to the bottom bar, pushing the conditional dmenu again
author
Anselm R. Garbe <
[email protected]
>
Thu, 8 Feb 2007 10:17:11 +0000
(11:17 +0100)
committer
Anselm R. Garbe <
[email protected]
>
Thu, 8 Feb 2007 10:17:11 +0000
(11:17 +0100)
dmenu.1
diff
|
blob
|
history
main.c
diff
|
blob
|
history
diff --git
a/dmenu.1
b/dmenu.1
index
88dd9ef
..
c682711
100644
(file)
--- a/
dmenu.1
+++ b/
dmenu.1
@@
-3,6
+3,7
@@
dmenu \- dynamic menu
.SH SYNOPSIS
.B dmenu
dmenu \- dynamic menu
.SH SYNOPSIS
.B dmenu
+.RB [ \-b ]
.RB [ \-fn " <font>"]
.RB [ \-nb " <color>"]
.RB [ \-nf " <color>"]
.RB [ \-fn " <font>"]
.RB [ \-nb " <color>"]
.RB [ \-nf " <color>"]
@@
-19,6
+20,9
@@
It manages huge amounts (up to 10.000 and more) of user defined menu items
efficiently.
.SS Options
.TP
efficiently.
.SS Options
.TP
+.B \-b
+makes dmenu appear at the screen bottom (by default it appears at the screen top).
+.TP
.B \-fn <font>
defines the font.
.TP
.B \-fn <font>
defines the font.
.TP
diff --git
a/main.c
b/main.c
index
224d298
..
f1f71fd
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-342,6
+342,7
@@
DC dc = {0};
int
main(int argc, char *argv[]) {
int
main(int argc, char *argv[]) {
+ Bool bottom = False;
char *font = FONT;
char *maxname;
char *normbg = NORMBGCOLOR;
char *font = FONT;
char *maxname;
char *normbg = NORMBGCOLOR;
@@
-360,7
+361,10
@@
main(int argc, char *argv[]) {
timeout.tv_sec = 3;
/* command line args */
for(i = 1; i < argc; i++)
timeout.tv_sec = 3;
/* command line args */
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];
}
else if(!strncmp(argv[i], "-nb", 4)) {
if(++i < argc) font = argv[i];
}
else if(!strncmp(argv[i], "-nb", 4)) {
@@
-386,7
+390,7
@@
main(int argc, char *argv[]) {
exit(EXIT_SUCCESS);
}
else
exit(EXIT_SUCCESS);
}
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);
setlocale(LC_CTYPE, "");
dpy = XOpenDisplay(0);
" [-sb <color>] [-sf <color>] [-t <seconds>] [-v]\n", stdout);
setlocale(LC_CTYPE, "");
dpy = XOpenDisplay(0);
@@
-430,7
+434,7
@@
main(int argc, char *argv[]) {
mw = DisplayWidth(dpy, screen);
mh = dc.font.height + 2;
win = XCreateWindow(dpy, root, 0,
mw = DisplayWidth(dpy, screen);
mh = dc.font.height + 2;
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,
DefaultVisual(dpy, screen),
CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
DefaultDepth(dpy, screen), CopyFromParent,
DefaultVisual(dpy, screen),
CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);