aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/menu_path13
-rwxr-xr-xbin/menu_run2
2 files changed, 15 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
diff --git a/bin/menu_run b/bin/menu_run
new file mode 100755
index 0000000..5a1b9a0
--- /dev/null
+++ b/bin/menu_run
@@ -0,0 +1,2 @@
+#!/bin/sh
+menu_path | menu "$@" | ${SHELL:-"/bin/sh"} &