slackbuilds_ponce/desktop/dmenu/dmenu_path
Phillip Warner 2cbbd42d56 desktop/dmenu: Revert to the dmenu_path script from 4.1.1
The dmenu_path in dmenu 4.3.1 seems to be picking up
non-executables on my system.  I was thinking of waiting
until upstream fixes this, but there is still some churn
going on regarding the dmenu_run/path scripts.  I figured
it would be better to get this small fix out there in the
mean time.

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
2011-08-11 20:28:35 -03:00

26 lines
344 B
Bash

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