|
|
@ -3,24 +3,24 @@ CACHE=$HOME/.dmenu_cache |
|
|
|
IFS=: |
|
|
|
IFS=: |
|
|
|
|
|
|
|
|
|
|
|
uptodate() { |
|
|
|
uptodate() { |
|
|
|
test ! -f $CACHE && return 1 |
|
|
|
test -f "$CACHE" && |
|
|
|
for dir in $PATH |
|
|
|
for dir in $PATH |
|
|
|
do |
|
|
|
do |
|
|
|
test $dir -nt $CACHE && return 1 |
|
|
|
test ! $dir -nt "$CACHE" || return 1 |
|
|
|
done |
|
|
|
done |
|
|
|
return 0 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ! uptodate |
|
|
|
if ! uptodate |
|
|
|
then |
|
|
|
then |
|
|
|
for dir in $PATH |
|
|
|
for dir in $PATH |
|
|
|
do |
|
|
|
do |
|
|
|
for file in "$dir"/* |
|
|
|
cd "$dir" && |
|
|
|
|
|
|
|
for file in * |
|
|
|
do |
|
|
|
do |
|
|
|
test -x "$file" && echo "${file##*/}" |
|
|
|
test -x "$file" && echo "$file" |
|
|
|
done |
|
|
|
done |
|
|
|
done | sort | uniq > $CACHE.$$ |
|
|
|
done | sort -u > "$CACHE".$$ && |
|
|
|
mv $CACHE.$$ $CACHE |
|
|
|
mv "$CACHE".$$ "$CACHE" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
cat $CACHE |
|
|
|
cat "$CACHE" |
|
|
|