From 4bf9e85448b10d2da5798797af76f37b3e3fbd9d Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Tue, 30 Nov 2021 15:23:59 -0500 Subject: [PATCH] fix password listing; clean-up some cruft password listing didn't include relative path --- wofi-pass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wofi-pass b/wofi-pass index 1145725..eb5b862 100755 --- a/wofi-pass +++ b/wofi-pass @@ -54,7 +54,7 @@ _pass_get() { elif [ "$1" = "OTP" ]; then pass otp "$password" | tail -n1 | { IFS= read -r pass; printf %s "$pass"; } else - printf '%s' "$(_pass_field "$@")" + _pass_field "$@" fi } @@ -84,8 +84,8 @@ if [ "$help" -eq 1 ]; then exit 0 fi -prefix=${PASSWORD_STORE_DIR-~/.password-store} -password_files="$(find "$prefix" -name "*.gpg" -execdir basename {} .gpg ';')" +cd "${PASSWORD_STORE_DIR:-$HOME/.password-store}" +password_files="$(find . -name "*.gpg" | sed "s/^\.\/\(.*\)\.gpg$/\1/")" password=$(printf '%s\n' "$password_files" | wofi --dmenu) [ -n "$password" ] || exit