diff options
-rwxr-xr-x | rofi-pass | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -683,6 +683,12 @@ manageEntry () { fi } +edit_pass() { + if [[ $edit_new_pass == "true" ]]; then + PASSWORD_STORE_DIR="${root}" pass edit "${1}" + fi +} + insertPass () { url=$(xclip --selection clipboard -o) @@ -744,13 +750,13 @@ insertPass () { "${USERNAME_field}: ${user}" "${URL_field}: ${url}" ) - printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${name}" > /dev/null && PASSWORD_STORE_DIR="${root}" pass edit "${name}" + printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${name}" > /dev/null && edit_pass "${name}" else pass_content=("${pw}" "---" "${USERNAME_field}: ${user}" ) - printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${name}" > /dev/null && PASSWORD_STORE_DIR="${root}" pass edit "${name}" + printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${name}" > /dev/null && edit_pass "${name}" fi else if [[ $url == http* ]]; then @@ -759,16 +765,13 @@ insertPass () { "${USERNAME_field}: ${user}" "${URL_field}: ${url}" ) - printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${group}/${name}" > /dev/null && PASSWORD_STORE_DIR="${root}" pass edit "${group}/${name}" + printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${group}/${name}" > /dev/null && edit_pass "${group}/${name}" else pass_content=("${pw}" "---" "${USERNAME_field}: ${user}" ) - printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${group}/${name}" > /dev/null - if [[ $edit_new_pass == "true" ]]; then - PASSWORD_STORE_DIR="${root}" pass edit "${group}/${name}" - fi + printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${group}/${name}" > /dev/null && edit_pass "${group}/${name}" fi fi } |