diff options
Diffstat (limited to 'dmenu_run')
-rwxr-xr-x | dmenu_run | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 |