pass edit with non-GUI editor

Matthias Braun matthias at bullbytes.com
Tue Nov 26 09:32:48 CET 2019


I'd like to open a password entry using NeoVim in a terminal window.

This is my current script:

    #!/usr/bin/env bash

    shopt -s nullglob globstar

    prefix=${PASSWORD_STORE_DIR-~/.password-store}
    password_files=( "$prefix"/**/*.gpg )

    # Remove the password store directories from its entries
    password_files=( "${password_files[@]#"$prefix"/}" )
    # Remove the ".gpg" ending
    password_files=( "${password_files[@]%.gpg}" )

    password_entry=$(printf '%s\n' "${password_files[@]}" | rofi -dmenu "$@")

    [[ -n $password_entry ]] || exit

    pass edit "$password_entry"

What I'd like to do is make `pass edit` open a new instance of termite (my terminal emulator) and pass the temporary file containing the password entry to NeoVim.

Is there a way to do this?


More information about the Password-Store mailing list