cache option in config.mk d515d275
Connor Lane Smith · 2011-01-07 18:54 2 file(s) · +5 −5
config.mk +4 −2
1 1
# dmenu version
2 2
VERSION = 4.2.1
3 3
4 -
# Customize below to fit your system
4 +
# dmenu_path cache (absolute or relative to $HOME)
5 +
CACHE = .dmenu_cache
6 +
5 7
6 8
# paths
7 9
PREFIX = /usr/local
19 21
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS}
20 22
21 23
# flags
22 -
CPPFLAGS = -D_BSD_SOURCE -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
24 +
CPPFLAGS = -D_BSD_SOURCE -DVERSION=\"${VERSION}\" -DCACHE=\"${CACHE}\" ${XINERAMAFLAGS}
23 25
CFLAGS   = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
24 26
LDFLAGS  = -s ${LIBS}
25 27
dmenu_path.c +1 −3
7 7
#include <unistd.h>
8 8
#include <sys/stat.h>
9 9
10 -
#define CACHE ".dmenu_cache"
11 -
12 10
static void die(const char *s);
13 11
static int qstrcmp(const void *a, const void *b);
14 12
static void scan(void);
26 24
	if(chdir(home) < 0)
27 25
		die("chdir failed");
28 26
	if(uptodate()) {
29 -
		execlp("cat", "cat", CACHE, NULL);
27 +
		execl("/bin/cat", "cat", CACHE, NULL);
30 28
		die("exec failed");
31 29
	}
32 30
	scan();