This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/bin/fzfp

14 lines
451 B
Text
Raw Normal View History

2020-01-28 09:45:04 -06:00
#!/usr/bin/env sh
2020-04-21 16:38:58 -05:00
FZFP_PASS_CMD="pass"
FZFP_PASS_DIR="$HOME/.password-store"
FZFP_HEIGHT="${FZFP_HEIGHT:-40%}"
FZFP_PROMPT="${FZFP_PROMPT:-"$FZFP_PASS_CMD@$FZFP_PASS_DIR> "}"
FZFP_PASS_OPTS="${FZFP_PASS_OPTS:-}"
cd "$FZFP_PASS_DIR" || { echo "Could not cd to $FZFP_PASS_DIR" >&2; exit 1; }
pp="$(fd gpg | sd ".gpg" "" | fzf --height "$FZFP_HEIGHT" --prompt "$FZFP_PROMPT")"
"${FZFP_PASS_CMD}" $FZFP_PASS_OPTS "$@" "$pp"
cd - >/dev/null || return 1