commit c8b2c691672214234e462a9e632debfd34eea6f6 parent 0c1950a63c170716ae01b84a9666daa94380c11c Author: Alex Balgavy <alex@balgavy.eu> Date: Wed, 4 May 2022 19:18:18 +0200 fzfchoose: open a new terminal if needed Diffstat:
M | scripts/fzfchoose | | | 17 | ++++++++++++++++- |
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/scripts/fzfchoose b/scripts/fzfchoose @@ -1,2 +1,17 @@ #!/bin/sh -fzf-tmux --prompt="Choose > " --layout=reverse +case "$TERM" in + # 'dumb' works to determine when running from a plumbing script via bettertouchtool + dumb) + a=$(mktemp) + b=$(mktemp) + trap 'rm $a $b' INT TERM EXIT + cat - > $a + alacritty -e sh -c "fzf --prompt='Choose > ' --layout=reverse <$a >$b" + cat $b + rm $a $b + trap - INT TERM EXIT + ;; + *) + fzf-tmux --prompt="Choose > " --layout=reverse + ;; +esac