From fa9ba1d2630138c95cdb86b49227132ad7b8f5af Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Fri, 10 Dec 2021 18:39:47 +0100 Subject: [PATCH] Add a better POSIX compliant way of getting a list of passwords --- .local/bin/passwords | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.local/bin/passwords b/.local/bin/passwords index 4e5967d5..ca0c077a 100644 --- a/.local/bin/passwords +++ b/.local/bin/passwords @@ -3,7 +3,7 @@ totp_tmp="${XDG_CACHE_HOME:-$HOME/.cache}/totp-tmp.png" getPasswords() { - choice="$(pass | sed -E "1d;s/(└|├|─|─ )//g" | grep -v "totp" | dmenu -i -p "Passwords")" + choice="$(find "${PASSWORD_STORE_DIR--~/.password-store}" -type f | sed "s|${PASSWORD_STORE_DIR-~/.password-store}/|| ; s/.gpg$// ; /.gpg-id/d" | sort | grep -v "totp" | dmenu -i -p "Passwords")" [ -z "$choice" ] && exit @@ -11,7 +11,7 @@ getPasswords() { } getTOTP() { - choice="$(pass | sed -E "1d;s/(└|├|─|─ )//g" | grep "totp" | dmenu -i -p "OTP")" + choice="$(find "${PASSWORD_STORE_DIR--~/.password-store}" -type f | sed "s|${PASSWORD_STORE_DIR-~/.password-store}/|| ; s/.gpg$// ; /.gpg-id/d" | sort | grep "totp" | dmenu -i -p "OTP")" [ -z "$choice" ] && exit @@ -40,15 +40,15 @@ addPassword() { case "$(printf "Random password\\nManual password" | dmenu -i -p "Passwords")" in "Random password") - case "$(printf "Simple\\nComplex" | dmenu -i -p "Passwords")" in - "Simple") - addPass=$(tr -dc 'A-Za-z0-9' ?@[\]^_`{|}~'