Xinqi Bao's Git
projects
/
dmenu.git
/ diff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
201b056
)
applied Stefan Tibus' sun patch, added -bottom option to dmenu which makes it appear...
author
arg@mig29 <unknown>
Mon, 18 Dec 2006 11:52:58 +0000
(12:52 +0100)
committer
arg@mig29 <unknown>
Mon, 18 Dec 2006 11:52:58 +0000
(12:52 +0100)
config.mk
diff
|
blob
|
history
dmenu.1
diff
|
blob
|
history
main.c
diff
|
blob
|
history
diff --git
a/config.mk
b/config.mk
index
00fe5a9
..
1670243
100644
(file)
--- a/
config.mk
+++ b/
config.mk
@@
-20,6
+20,11
@@
LDFLAGS = ${LIBS}
#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = -g ${LIBS}
#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = -g ${LIBS}
+# Solaris
+#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
+#LDFLAGS = ${LIBS}
+#CFLAGS += -xtarget=ultra
+
# compiler and linker
CC = cc
LD = ${CC}
# compiler and linker
CC = cc
LD = ${CC}
diff --git
a/dmenu.1
b/dmenu.1
index
694debd
..
76bb71c
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 [ \-bottom ]
.RB [ \-font " <name>"]
.RB [ \-normbg " <color>"]
.RB [ \-normfg " <color>"]
.RB [ \-font " <name>"]
.RB [ \-normbg " <color>"]
.RB [ \-normfg " <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 \-bottom
+makes dmenu appear at the screen bottom (by default it appears at the screen top).
+.TP
.B \-font <name>
defines the font.
.TP
.B \-font <name>
defines the font.
.TP
diff --git
a/main.c
b/main.c
index
1c6e57f
..
7fca45e
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-330,6
+330,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;
@@
-347,7
+348,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], "-font", 6)) {
+ if(!strncmp(argv[i], "-bottom", 8)) {
+ bottom = True;
+ }
+ else if(!strncmp(argv[i], "-font", 6)) {
if(++i < argc) font = argv[i];
}
else if(!strncmp(argv[i], "-normbg", 8)) {
if(++i < argc) font = argv[i];
}
else if(!strncmp(argv[i], "-normbg", 8)) {
@@
-373,7
+377,8
@@
main(int argc, char *argv[]) {
exit(EXIT_SUCCESS);
}
else
exit(EXIT_SUCCESS);
}
else
- eprint("usage: dmenu [-font <name>] [-{norm,sel}{bg,fg} <color>] [-p <prompt>] [-t <seconds>] [-v]\n", stdout);
+ eprint("usage: dmenu [-bottom] [-font <name>] [-{norm,sel}{bg,fg} <color>]\n"
+ " [-p <prompt>] [-t <seconds>] [-v]\n", stdout);
setlocale(LC_CTYPE, "");
dpy = XOpenDisplay(0);
if(!dpy)
setlocale(LC_CTYPE, "");
dpy = XOpenDisplay(0);
if(!dpy)
@@
-406,7
+411,12
@@
main(int argc, char *argv[]) {
wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask;
mx = my = 0;
mw = DisplayWidth(dpy, screen);
wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask;
mx = my = 0;
mw = DisplayWidth(dpy, screen);
- mh = dc.font.height + 2;
+ if(bottom) {
+ mh = dc.font.ascent + dc.font.descent + 3; // match wmii
+ my = DisplayHeight(dpy, screen) - mh;
+ }
+ else
+ mh = dc.font.height + 2;
win = XCreateWindow(dpy, root, mx, my, mw, mh, 0,
DefaultDepth(dpy, screen), CopyFromParent,
DefaultVisual(dpy, screen),
win = XCreateWindow(dpy, root, mx, my, mw, mh, 0,
DefaultDepth(dpy, screen), CopyFromParent,
DefaultVisual(dpy, screen),