dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit ffa9c2feb1aa2cc52c0c90e2be082f96847109a7
parent 7122e7194fe233480dd9ab745a2ce36755a6a9e4
Author: Alex Balgavy <alex@balgavy.eu>
Date:   Fri,  2 Sep 2022 12:33:10 +0200

fzfchoose: allow passing in prompt

Diffstat:
Mscripts/fzfchoose | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/scripts/fzfchoose b/scripts/fzfchoose @@ -1,17 +1,18 @@ #!/bin/sh +prompt="${1:-Choose > }" 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 + cat - > "$a" + alacritty -e sh -c "fzf --prompt='$prompt' --layout=reverse <$a >$b" + cat "$b" + rm "$a" "$b" trap - INT TERM EXIT ;; *) - fzf-tmux --prompt="Choose > " --layout=reverse + fzf-tmux --prompt="$prompt" --layout=reverse ;; esac