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/common/bin/fzfp

17 lines
487 B
Bash
Executable file

#!/usr/bin/env sh
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; }
# TODO: weighted history (see ./launch)
"${FZFP_PASS_CMD}" $FZFP_PASS_OPTS "$@" \
"$(fd gpg | sd ".gpg" "" | fzf --height "$FZFP_HEIGHT" --prompt "$FZFP_PROMPT")"
cd - >/dev/null || return 1