2007-12-22 12:20:20 +00:00
|
|
|
#!/bin/sh
|
2011-11-19 20:24:07 +00:00
|
|
|
cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
|
|
|
|
if [ -d "$cachedir" ]; then
|
|
|
|
cache=$cachedir/dmenu_run
|
|
|
|
else
|
2011-12-19 15:05:55 +00:00
|
|
|
cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~
|
2011-10-17 02:12:33 +01:00
|
|
|
fi
|
2011-06-13 21:50:31 +01:00
|
|
|
(
|
|
|
|
IFS=:
|
2011-11-19 20:24:07 +00:00
|
|
|
if [ "`ls -dt $PATH "$cache" | head -n 1`" != "$cache" ]; then
|
|
|
|
lsx $PATH | sort -u | tee "$cache" | dmenu "$@"
|
|
|
|
else
|
|
|
|
dmenu "$@" < "$cache"
|
2011-06-13 21:50:31 +01:00
|
|
|
fi
|
2011-12-09 10:36:26 +00:00
|
|
|
) | ${SHELL:-"/bin/sh"} &
|