summaryrefslogtreecommitdiff
path: root/dmenu_path
blob: 7f356f505323c7169da89863f58f4f987b44f28e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
cache="$cachedir/dmenu_run"
configdir="${XDG_CONFIG_HOME:-"$HOME/.config/dmenu"}"
config="$configdir/dmenu_omitlist"

[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
[ ! -e "$configdir" ] && mkdir -p "$configdir"

IFS=:

if stest -dqr -n "$cache" $PATH || [ "$config" -nt "$cache" ]; then
	stest -flx $PATH | sort -u | grep -wvF -f $config | tee "$cache"
else
	cat "$cache"
fi