#!/bin/sh
# Script for 'pass'

# Ask for password name in vault
password=$(find ~/.password-store/ -type f -name '*.gpg' |
	sed 's/.*\/\(.*\)\.gpg$/\1/' | dmenu -i -p "Password:")

# Exit if none chosen
[ -z "$password" ] && exit

# If chosen, use xdotool to type it
pass=$(pass show "$password" | head -1)
xdotool type "$pass" && notify-send " $password" "Successfully decrypted"