dmenu/dmenu_run

16 lines
328 B
Plaintext
Raw Normal View History

2007-12-22 13:20:20 +01:00
#!/bin/sh
2011-11-19 21:24:07 +01:00
cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
if [ -d "$cachedir" ]; then
cache=$cachedir/dmenu_run
else
cache=$HOME/.dmenu_cache
2011-10-17 03:12:33 +02:00
fi
2011-06-13 22:50:31 +02:00
(
IFS=:
2011-11-19 21:24:07 +01:00
if [ "`ls -dt $PATH "$cache" | head -n 1`" != "$cache" ]; then
lsx $PATH | sort -u | tee "$cache" | dmenu "$@"
else
dmenu "$@" < "$cache"
2011-06-13 22:50:31 +02:00
fi
2011-11-23 15:17:32 +01:00
) | exec ${SHELL:-"/bin/sh"}