Compare commits

..

8 Commits
2.8 ... 3.1

9 changed files with 55 additions and 27 deletions

View File

@ -28,3 +28,5 @@ b6e09682c8adcb6569656bee73c311f9ab457715 2.3
041143e9fc544c62edc58af52cae9ac5237e5945 2.5 041143e9fc544c62edc58af52cae9ac5237e5945 2.5
775f761a5647a05038e091d1c99fc35d3034cd68 2.6 775f761a5647a05038e091d1c99fc35d3034cd68 2.6
fbd9e9d63f202afe6834ccfdf890904f1897ec0b 2.7 fbd9e9d63f202afe6834ccfdf890904f1897ec0b 2.7
dd3d02b07cac44fbafc074a361c1002cebe7aae4 2.8
59b3024854db49739c6d237fa9077f04a2da847a 3.0

View File

@ -1,7 +1,7 @@
MIT/X Consortium License MIT/X Consortium License
(C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com> © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
(C)opyright MMVI-MMVII Sander van Dijk <a dot h dot vandijk at gmail dot com> © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"), copy of this software and associated documentation files (the "Software"),

View File

@ -1,5 +1,5 @@
# dmenu - dynamic menu # dmenu - dynamic menu
# (C)opyright MMVI-MMVII Anselm R. Garbe # © 2006-2007 Anselm R. Garbe, Sander van Dijk
include config.mk include config.mk
@ -23,7 +23,6 @@ ${OBJ}: dmenu.h config.mk
dmenu: ${OBJ} dmenu: ${OBJ}
@echo CC -o $@ @echo CC -o $@
@${CC} -o $@ ${OBJ} ${LDFLAGS} @${CC} -o $@ ${OBJ} ${LDFLAGS}
@strip $@
clean: clean:
@echo cleaning @echo cleaning

View File

@ -1,5 +1,5 @@
# dmenu version # dmenu version
VERSION = 2.8 VERSION = 3.1
# Customize below to fit your system # Customize below to fit your system
@ -16,7 +16,7 @@ LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
# flags # flags
CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\"
LDFLAGS = ${LIBS} LDFLAGS = -s ${LIBS}
#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\" #CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = -g ${LIBS} #LDFLAGS = -g ${LIBS}

View File

@ -1,7 +1,6 @@
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com> /* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. * © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
*/ * See LICENSE file for license details. */
#include <X11/Xlib.h> #include <X11/Xlib.h>
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*" #define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"

View File

@ -1,9 +1,30 @@
#!/bin/sh #!/bin/sh
CACHE=$HOME/.dmenu_cache
UPTODATE=1
IFS=: IFS=:
if test ! -f $CACHE
then
unset UPTODATE
fi
if test $UPTODATE
then
for dir in $PATH
do
test $dir -nt $CACHE && unset UPTODATE
done
fi
if test ! $UPTODATE
then
for dir in $PATH for dir in $PATH
do do
for file in "$dir"/* for file in "$dir"/*
do do
test -x "$file" && echo "${file##*/}" test -x "$file" && echo "${file##*/}"
done done
done | sort | uniq done | sort | uniq > $CACHE
fi
cat $CACHE

7
draw.c
View File

@ -1,7 +1,6 @@
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com> /* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
* (C)opyright MMVI-MMVII Sander van Dijk <a dot h dot vandijk at gmail dot com> * © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
* See LICENSE file for license details. * See LICENSE file for license details. */
*/
#include "dmenu.h" #include "dmenu.h"
#include <string.h> #include <string.h>

18
main.c
View File

@ -1,7 +1,6 @@
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com> /* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
* (C)opyright MMVI-MMVII Sander van Dijk <a dot h dot vandijk at gmail dot com> * © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
* See LICENSE file for license details. * See LICENSE file for license details. */
*/
#include "dmenu.h" #include "dmenu.h"
#include <ctype.h> #include <ctype.h>
#include <locale.h> #include <locale.h>
@ -136,6 +135,8 @@ initfont(const char *fontstr) {
char *def, **missing; char *def, **missing;
int i, n; int i, n;
if(!fontstr || fontstr[0] == '\0')
eprint("error, cannot load font: '%s'\n", fontstr);
missing = NULL; missing = NULL;
if(dc.font.set) if(dc.font.set)
XFreeFontSet(dpy, dc.font.set); XFreeFontSet(dpy, dc.font.set);
@ -216,6 +217,13 @@ kpress(XKeyEvent * e) {
len = strlen(text); len = strlen(text);
buf[0] = 0; buf[0] = 0;
num = XLookupString(e, buf, sizeof buf, &ksym, 0); num = XLookupString(e, buf, sizeof buf, &ksym, 0);
if(IsKeypadKey(ksym)) {
if(ksym == XK_KP_Enter) {
ksym = XK_Return;
} else if(ksym >= XK_KP_0 && ksym <= XK_KP_9) {
ksym = (ksym - XK_KP_0) + XK_0;
}
}
if(IsFunctionKey(ksym) || IsKeypadKey(ksym) if(IsFunctionKey(ksym) || IsKeypadKey(ksym)
|| IsMiscFunctionKey(ksym) || IsPFKey(ksym) || IsMiscFunctionKey(ksym) || IsPFKey(ksym)
|| IsPrivateKeypadKey(ksym)) || IsPrivateKeypadKey(ksym))
@ -451,7 +459,7 @@ main(int argc, char *argv[]) {
if(++i < argc) selfg = argv[i]; if(++i < argc) selfg = argv[i];
} }
else if(!strncmp(argv[i], "-v", 3)) else if(!strncmp(argv[i], "-v", 3))
eprint("dmenu-"VERSION", (C)opyright MMVI-MMVII Anselm R. Garbe\n"); eprint("dmenu-"VERSION", © 2006-2007 Anselm R. Garbe, Sander van Dijk\n");
else else
usage(); usage();
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");

6
util.c
View File

@ -1,6 +1,6 @@
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com> /* © 2006-2007 Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details. * © 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
*/ * See LICENSE file for license details. */
#include "dmenu.h" #include "dmenu.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>