dotfiles/scripts/dmenu-pass
2023-07-02 22:46:35 -06:00

12 lines
397 B
Bash
Executable file

#!/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
xdotool type "$(pass $password | head -1)" && [ -e /usr/bin/notify-send ] && notify-send "$password" "Successfully decrypted"