Xinqi Bao's Git
projects
/
dmenu.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
fixed extra warnings
[dmenu.git]
/
dmenu_path
diff --git
a/dmenu_path
b/dmenu_path
index
72ff3ed
..
1b1b241
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 | uniq
+CACHE=$HOME/.dmenu_cache
+IFS=:
+
+if ! test -f "$CACHE" || find $PATH -type d -newer "$CACHE" | grep -q .; then
+ find $PATH ! -type d \( -perm -1 -o -perm -10 -o -perm -100 \) | sed 's/.*\///' | sort -u > "$CACHE"
+fi
+
+cat "$CACHE"