X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=dmenu_path;h=c1d3357708ae03ee8c3d03e605733cb3fd3daebf;hb=d066975e78d98f368ab0e3106e00804a28697373;hp=3070eb74944010eaa65588d58e69cc894635f2a8;hpb=5f436fdcb733cf9c669a0c94ad95878163f04b9a;p=dmenu.git diff --git a/dmenu_path b/dmenu_path index 3070eb7..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 }' | /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 f \( -perm -1 -o -perm -10 -o -perm -100 \) | sed 's/.*\///' | sort -u > "$CACHE" +fi + +cat "$CACHE"