aboutsummaryrefslogtreecommitdiff
path: root/bin/menu_path
diff options
context:
space:
mode:
Diffstat (limited to 'bin/menu_path')
-rwxr-xr-xbin/menu_path13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/menu_path b/bin/menu_path
new file mode 100755
index 0000000..151a637
--- /dev/null
+++ b/bin/menu_path
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
+cache="$cachedir/menu_run"
+
+[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
+
+IFS=:
+if filter -dqr -n "$cache" $PATH; then
+ filter -flx $PATH | sort -u | tee "$cache"
+else
+ cat "$cache"
+fi