[download]

local/bin/passmenu

   1 #!/bin/bash
   2 
   3 cd ${PASSWORD_STORE_DIR:-~/.password-store} || exit
   4 _pass(){ printf 'Пароль %s@%s в буфере\n' "$2" "$1"; } && export -f _pass
   5 
   6 s=$(find * -type f | sed 's/\.gpg//' | menu -i pass) || exit
   7 n=$(
   8     pass $s | sed '/^\s*$/d' | awk -F : -v s=$s '
   9         BEGIN { print NR ". " s }
  10               { print NR ". " (NR == 1 ? "password" : $1) }
  11         END   { print (NR + 1) ". Edit" }
  12     ' | sed -E 's/[^ ]+/\u\0/g' | menu -i pass -p $s
  13 ) || exit
  14 
  15 [[ $n == 0*    ]] && { chromium https://${s%%/*} & exit; }
  16 [[ $n == *Edit ]] && { term pass edit $s & exit; }
  17 
  18 pass $s | sed '/^\s*$/d' | sed "${n%%.*}q; d" |
  19 { [[ $n == 1* ]] && cat || sed 's/^.*: //'; } |
  20 tr -d \\n | xsel -ibt 10000 && notify _pass $s ${n#*. }