Xinqi Bao's Git
projects
/
dmenu.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
whoops, wrong dmenu_path version
[dmenu.git]
/
dmenu_path
diff --git
a/dmenu_path
b/dmenu_path
index
4008f4c
..
c1d3357
100755
(executable)
--- a/
dmenu_path
+++ b/
dmenu_path
@@
-1,2
+1,9
@@
#!/bin/sh
#!/bin/sh
-/bin/ls -lL `echo $PATH | tr : ' '` 2> /dev/null | awk '$1 ~ /^[^d].*x/ { print $NF }' | sort -u
+CACHE=$HOME/.dmenu_cache
+IFS=:
+
+if ! test -f "$CACHE" || find $PATH -type d -newer "$CACHE" | grep -q .; then
+ find $PATH -type f \( -perm -1 -o -perm -10 -o -perm -100 \) | sed 's/.*\///' | sort -u > "$CACHE"
+fi
+
+cat "$CACHE"