#!/bin/sh
set -eu

export PASSWORD_STORE_DIR="$HOME/dev/libre/others/password-store"

choice="$(find "$PASSWORD_STORE_DIR" -type f                  | \
            grep -Ev '(.git|.gpg-id)'                         | \
            sed -e "s|$PASSWORD_STORE_DIR/||" -e 's/\.gpg$//' | \
            remembering -p password-store \
                        -c "dmenu -l 20 -i -p 'Pass: ' -fn Monospace-18")"

if [ -n "$choice" ]; then
  pass show "$choice" -c
fi
