X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=dmenu_path;h=1b1b241d9aaeaa03058d4ac143f6169ba732b56d;hb=6cc0b0dc086feaf944b166d0b459ac407192ea5e;hp=3070eb74944010eaa65588d58e69cc894635f2a8;hpb=5f436fdcb733cf9c669a0c94ad95878163f04b9a;p=dmenu.git diff --git a/dmenu_path b/dmenu_path index 3070eb7..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 }' | /usr/bin/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"