diff options
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | dmenu_path | 13 | ||||
-rwxr-xr-x | dmenu_run | 15 |
3 files changed, 18 insertions, 16 deletions
@@ -35,7 +35,7 @@ clean: | |||
35 | dist: clean | 35 | dist: clean |
36 | @echo creating dist tarball | 36 | @echo creating dist tarball |
37 | @mkdir -p dmenu-${VERSION} | 37 | @mkdir -p dmenu-${VERSION} |
38 | @cp LICENSE Makefile README config.mk dmenu.1 draw.h dmenu_run stest.1 ${SRC} dmenu-${VERSION} | 38 | @cp LICENSE Makefile README config.mk dmenu.1 draw.h dmenu_path dmenu_run stest.1 ${SRC} dmenu-${VERSION} |
39 | @tar -cf dmenu-${VERSION}.tar dmenu-${VERSION} | 39 | @tar -cf dmenu-${VERSION}.tar dmenu-${VERSION} |
40 | @gzip dmenu-${VERSION}.tar | 40 | @gzip dmenu-${VERSION}.tar |
41 | @rm -rf dmenu-${VERSION} | 41 | @rm -rf dmenu-${VERSION} |
@@ -43,8 +43,9 @@ dist: clean | |||
43 | install: all | 43 | install: all |
44 | @echo installing executables to ${DESTDIR}${PREFIX}/bin | 44 | @echo installing executables to ${DESTDIR}${PREFIX}/bin |
45 | @mkdir -p ${DESTDIR}${PREFIX}/bin | 45 | @mkdir -p ${DESTDIR}${PREFIX}/bin |
46 | @cp -f dmenu dmenu_run stest ${DESTDIR}${PREFIX}/bin | 46 | @cp -f dmenu dmenu_path dmenu_run stest ${DESTDIR}${PREFIX}/bin |
47 | @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu | 47 | @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu |
48 | @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu_path | ||
48 | @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu_run | 49 | @chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu_run |
49 | @chmod 755 ${DESTDIR}${PREFIX}/bin/stest | 50 | @chmod 755 ${DESTDIR}${PREFIX}/bin/stest |
50 | @echo installing manual pages to ${DESTDIR}${MANPREFIX}/man1 | 51 | @echo installing manual pages to ${DESTDIR}${MANPREFIX}/man1 |
@@ -57,6 +58,7 @@ install: all | |||
57 | uninstall: | 58 | uninstall: |
58 | @echo removing executables from ${DESTDIR}${PREFIX}/bin | 59 | @echo removing executables from ${DESTDIR}${PREFIX}/bin |
59 | @rm -f ${DESTDIR}${PREFIX}/bin/dmenu | 60 | @rm -f ${DESTDIR}${PREFIX}/bin/dmenu |
61 | @rm -f ${DESTDIR}${PREFIX}/bin/dmenu_path | ||
60 | @rm -f ${DESTDIR}${PREFIX}/bin/dmenu_run | 62 | @rm -f ${DESTDIR}${PREFIX}/bin/dmenu_run |
61 | @rm -f ${DESTDIR}${PREFIX}/bin/stest | 63 | @rm -f ${DESTDIR}${PREFIX}/bin/stest |
62 | @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 | 64 | @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 |
diff --git a/dmenu_path b/dmenu_path new file mode 100644 index 0000000..338bac4 --- /dev/null +++ b/dmenu_path | |||
@@ -0,0 +1,13 @@ | |||
1 | #!/bin/sh | ||
2 | cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} | ||
3 | if [ -d "$cachedir" ]; then | ||
4 | cache=$cachedir/dmenu_run | ||
5 | else | ||
6 | cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~ | ||
7 | fi | ||
8 | IFS=: | ||
9 | if stest -dqr -n "$cache" $PATH; then | ||
10 | stest -flx $PATH | sort -u | tee "$cache" | ||
11 | else | ||
12 | cat "$cache" | ||
13 | fi | ||
@@ -1,15 +1,2 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} | 2 | dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} & |
3 | if [ -d "$cachedir" ]; then | ||
4 | cache=$cachedir/dmenu_run | ||
5 | else | ||
6 | cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~ | ||
7 | fi | ||
8 | ( | ||
9 | IFS=: | ||
10 | if stest -dqr -n "$cache" $PATH; then | ||
11 | stest -flx $PATH | sort -u | tee "$cache" | dmenu "$@" | ||
12 | else | ||
13 | dmenu "$@" < "$cache" | ||
14 | fi | ||
15 | ) | ${SHELL:-"/bin/sh"} & | ||