X-Git-Url: https://git.xinqibao.xyz/dmenu.git/blobdiff_plain/a71424ac0e74f05274a8009f07487112730fa472..26236a4900657e8e6e9c5fcf277b51ca242fa3e8:/dmenu_path?ds=inline diff --git a/dmenu_path b/dmenu_path index 4008f4c..c1d3357 100755 --- a/dmenu_path +++ b/dmenu_path @@ -1,2 +1,9 @@ #!/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"