ports/x11/dmenu2/files/dmenu2_path
Alexey Dokuchaev e122a29f2c Add `x11/dmenu2', a fork of classic dmenu with many enhancements and
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
2017-03-18 15:42:22 +00:00

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