new dmenu_run

This commit is contained in:
Connor Lane Smith 2011-06-13 21:50:31 +01:00
parent 8ec1b41cac
commit eadf090413
5 changed files with 15 additions and 26 deletions

View file

@ -1,2 +1,9 @@
#!/bin/sh
exe=`dmenu_path | dmenu ${1+"$@"}` && exec $exe
CACHE=${XDG_CACHE_HOME:-"$HOME/.cache"}/dmenu_run
(
IFS=:
if test "`ls -dt $PATH "$CACHE" 2> /dev/null | sed 1q`" != "$CACHE"; then
mkdir -p "`dirname "$CACHE"`" && lsx $PATH | sort -u > "$CACHE"
fi
)
cmd=`dmenu "$@" < "$CACHE"` && exec $cmd