dotfiles

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

fzfchoose (429B)


      1 #!/bin/sh
      2 prompt="${1:-Choose > }"
      3 case "$TERM" in
      4   # 'dumb' works to determine when running from a plumbing script via bettertouchtool
      5   dumb)
      6     a=$(mktemp)
      7     b=$(mktemp)
      8     trap 'rm $a $b' INT TERM EXIT
      9     cat - > "$a"
     10     alacritty -e sh -c "fzf --prompt='$prompt' --layout=reverse <$a >$b"
     11     cat "$b"
     12     rm "$a" "$b"
     13     trap - INT TERM EXIT
     14     ;;
     15   *)
     16     fzf-tmux --prompt="$prompt" --layout=reverse
     17     ;;
     18 esac