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

17 lines
487 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:-}"
2020-04-21 16:38:58 -05:00
cd "$FZFP_PASS_DIR" || { echo "Could not cd to $FZFP_PASS_DIR" >&2; exit 1; }
# TODO: weighted history (see ./launch)
"${FZFP_PASS_CMD}" $FZFP_PASS_OPTS "$@" \
"$(fd gpg | sd ".gpg" "" | fzf --height "$FZFP_HEIGHT" --prompt "$FZFP_PROMPT")"
2020-04-21 16:38:58 -05:00
cd - >/dev/null || return 1