$ git clone -q https://github.com/biox/pa.git
$ cd pa/contrib
$ ls -1 -p
pa-bemenu
pa-completion.bash
pa-completion.fish
pa-dmenu
pa-fuzzel
pa-pass
pa-rekey
pa-rofi
pa-ssg
pa-urn
pa-wmenu
$ nl -b a -s ' ' -w 3 pa-dmenu
  1
  2
  3
  4
  5
  6
  7
  8
  9
#!/bin/sh
#
# prompt for a password via dmenu
# generate new password if it doesn't exist
# then type the selected password via xdotool

name=$(pa l | dmenu "$@") || exit
{ pa s "$name" || { printf y | pa a "$name" >/dev/null && pa s "$name"; }; } |
    head -n 1 | tr -d '\n' | xdotool type --clearmodifiers --file -