dotfiles/dpass
2022-08-30 02:11:28 +02:00

10 lines
289 B
Bash
Executable file

#!/bin/sh
set -euo pipefail
cd ~/.password-store
passname=$(find -name "*.gpg" | sed -r 's|\./(.*)\.gpg$|\1|' | rofi -dmenu -p pass)
case "$passname" in
*-otp) password="$(pass otp "$passname")"; ;;
*) password="$(pass show "$passname" | sed '/^$/q')"; ;;
esac
ydotool type "$password"