#! /usr/bin/env sh main() { cd -- "$HOME/.password-store" || exit 1 file="$(find ./* -type f | sed 's-^\./--' | sed 's-\.gpg$--' | dmenu)" dmenu_exit=$? if [ "$dmenu_exit" -ne 0 ] then exit 2 fi pass show "$file" | head -n 1 | perl -pe 'chomp' | xdotool type --file - notify-send -i "dialog-password" "ipass" "$file" } main "$@"