X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=dmenu_path;h=c1d3357708ae03ee8c3d03e605733cb3fd3daebf;hb=d066975e78d98f368ab0e3106e00804a28697373;hp=72ff3ed416ed2fb67d5b0d6e83bd28b33e7da827;hpb=68a24f5535030473e90426c30fafe75262add419;p=dmenu.git diff --git a/dmenu_path b/dmenu_path index 72ff3ed..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 | uniq +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"