dmenu/dmenu_run

16 lines
350 B
Plaintext
Raw Normal View History

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