[pass] [PATCH 0/3] passmenu: Add option to notify-send after copying password

Emil Lundberg lundberg.emil at gmail.com
Sat Jul 25 18:21:34 CEST 2015

With these changes, passmenu can provide visual feedback confirming that the
password has been successfully copied to the cliboard. This is useful for
example if using passmenu on a weak laptop where the "gpg-askpass, unlock
keyring, decrypt password file, copy to clipboard" procedure can take a few
seconds to complete.

Summary of changes:

 - `pass show --clip` now checks to see if the shell function
   `PASSWORD_STORE_POST_COPY_HOOK` is present. If it is, it is called with two
    1. The name of the copied password (`foo/bar` if pass is invoked as `pass
    show -c foo/bar`)
    2. The `"Copied $2 to clipboard. Will clear in $CLIP_TIME" seconds.`
    message, which is also printed to the console

   This callback can be supplied for example by exporting it with `export -f`
   from a parent shell. This should not be a security vulnerability since
   anything that can successfully invoke `pass -c` can also get passwords in
   plaintext with a plain `pass show`, but please let me know if I overlooked
   something obvious in this design decision.

 - passmenu now accepts the `--notify` command line option. If `--notify` is
   specified and `--typeit` is not, then a desktop notification will be shown
   using `notify-send` after pass has copied the password to the clipboard.

Comments and critique are welcome!

These patches are also available as a GitHub pull request, since I was unaware
that e-mails were the preferred contribution method. :)

Emil Lundberg (3):
  Add hook for a callback after copying to clipboard
  passmenu: Use getopt to process options
  passmenu: Add option to notify-send after copying to clipboard

 contrib/dmenu/passmenu | 22 ++++++++++++++++++----
 src/password-store.sh  | 12 +++++++++++-
 2 files changed, 29 insertions(+), 5 deletions(-)


More information about the Password-Store mailing list