mirror of
https://git.freebsd.org/ports.git
synced 2025-06-26 15:10:35 -04:00
additional options. While original upstream is https://bitbucket.org/melek/dmenu2, prefer more up-to-date GitHub repo which was forked from it (and because of our nice USE_GITHUB support for fetching the distfiles). PR: 209391 Submitted by: Timothy Beyer
15 lines
358 B
Bash
15 lines
358 B
Bash
#!/bin/sh
|
|
|
|
# adapted from dmenu_path in the original dmenu distribution
|
|
cachedir=${XDG_CACHE_HOME:-$HOME/.cache}
|
|
if [ -d "$cachedir" ]; then
|
|
cache=$cachedir/dmenu2_run
|
|
else
|
|
cache=$HOME/.dmenu2_cache # if no xdg dir, fall back to dotfile in ~
|
|
fi
|
|
IFS=:
|
|
if stest2 -dqr -n "$cache" $PATH; then
|
|
stest2 -flx $PATH | sort -u | tee "$cache"
|
|
else
|
|
cat "$cache"
|
|
fi
|