2007-05-23 23:42:51 +03:00
|
|
|
#!/bin/sh -f
|
2007-05-14 12:56:41 +03:00
|
|
|
CACHE=$HOME/.dmenu_cache
|
2007-02-23 16:28:25 +02:00
|
|
|
IFS=:
|
2007-05-14 12:56:41 +03:00
|
|
|
|
2007-05-23 23:42:51 +03:00
|
|
|
qfind() {
|
|
|
|
find "$@" 2>/dev/null
|
|
|
|
}
|
|
|
|
|
2007-05-23 23:13:46 +03:00
|
|
|
uptodate() {
|
2007-05-23 23:42:51 +03:00
|
|
|
test -f $CACHE &&
|
|
|
|
test "$(echo "$PATH")" = "$(sed 1q "$CACHE")" &&
|
2007-05-24 02:38:23 +03:00
|
|
|
! qfind $PATH -maxdepth 0 -newer $CACHE >/dev/null
|
2007-05-23 23:42:51 +03:00
|
|
|
}
|
2007-05-14 12:56:41 +03:00
|
|
|
|
2007-05-23 14:22:27 +03:00
|
|
|
if ! uptodate
|
2007-05-14 12:56:41 +03:00
|
|
|
then
|
2007-05-23 23:42:51 +03:00
|
|
|
{
|
|
|
|
echo "$PATH"
|
2007-05-23 23:59:38 +03:00
|
|
|
qfind $PATH -type f -maxdepth 1 '(' -perm -u+x -o -perm -g+x -o -perm -o+x ')' |
|
2007-05-23 23:42:51 +03:00
|
|
|
sed 's,.*/,,' | sort | uniq
|
2007-05-24 02:38:23 +03:00
|
|
|
}
|
2007-05-23 23:42:51 +03:00
|
|
|
mv $CACHE.$pid $CACHE
|
2007-05-14 12:56:41 +03:00
|
|
|
fi
|
|
|
|
|
2007-05-23 23:42:51 +03:00
|
|
|
tail -n +2 $CACHE
|
|
|
|
|