From 068043773dac179cc03f08a64047823bc670ebdd Mon Sep 17 00:00:00 2001 From: yosh Date: Sun, 4 Feb 2024 20:06:42 -0500 Subject: [PATCH] fzfmenu-run: make generic --- fzfmenu-run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fzfmenu-run b/fzfmenu-run index 4d6c78f..1e48d1f 100755 --- a/fzfmenu-run +++ b/fzfmenu-run @@ -1,8 +1,8 @@ #!/bin/sh set -euf -cmd="$(IFS=':'; find $PATH \( -type f -o -type l \) | awk -F '/' '{print $NF}' | sort | uniq | fzfmenu --layout reverse --prompt 'run > ' "$@")" - +menu_cmd="${MENU:-fzfmenu} -p 'run > '" +cmd="$(IFS=':'; find $PATH \( -type f -o -type l \) | awk -F '/' '{print $NF}' | sort | uniq | eval "$menu_cmd")" # this menu will act as if you typed the command in a shell, hence eval and -e sh -c # this runs in userspace, so no eval security risk should be present # that is, no more of a risk than what said user could do with a shell themselves