X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=dmenu_path;h=1b1b241d9aaeaa03058d4ac143f6169ba732b56d;hb=43540746077d4fd8ef963b5939934d32d59c9417;hp=4008f4ce96f83cc5f4b1feeeaa5b2cb419f75ab4;hpb=a71424ac0e74f05274a8009f07487112730fa472;p=dmenu.git diff --git a/dmenu_path b/dmenu_path index 4008f4c..1b1b241 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 d \( -perm -1 -o -perm -10 -o -perm -100 \) | sed 's/.*\///' | sort -u > "$CACHE" +fi + +cat "$CACHE"