Change weird variable substitution

This commit is contained in:
krisdoodle45 2021-12-20 19:07:36 +01:00 committed by GitHub
parent 793cb61d7b
commit 3fbcb3d612
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,15 +3,15 @@
totp_tmp="${XDG_CACHE_HOME:-$HOME/.cache}/totp-tmp.png"
getPasswords() {
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")"
choice="$(find "${PASSWORD_STORE_DIR:-$HOME/.password-store}" -type f | sed "s|${PASSWORD_STORE_DIR:-$HOME/.password-store}/|| ; s/.gpg$// ; /.gpg-id/d" | sort | grep -v "totp" | dmenu -i -p "Passwords")"
[ -z "$choice" ] && exit
pass -c "$choice" && notify-send "📋 Password for $choice copied!" || notify-send "⚠️ Something went wrong. Make sure you have initialized pass"
}
}
getTOTP() {
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")"
choice="$(find "${PASSWORD_STORE_DIR:-$HOME/.password-store}" -type f | sed "s|${PASSWORD_STORE_DIR:-$HOME/.password-store}/|| ; s/.gpg$// ; /.gpg-id/d" | sort | grep "totp" | dmenu -i -p "OTP")"
[ -z "$choice" ] && exit
@ -62,7 +62,7 @@ addPassword() {
}
removePassword() {
name="$(find "${PASSWORD_STORE_DIR--~/.password-store}" -type f | sed "s|${PASSWORD_STORE_DIR-~/.password-store}/|| ; s/.gpg$// ; /.gpg-id/d" | sort | dmenu -i -p "Passwords")"
name="$(find "${PASSWORD_STORE_DIR:-$HOME/.password-store}" -type f | sed "s|${PASSWORD_STORE_DIR:-$HOME/.password-store}/|| ; s/.gpg$// ; /.gpg-id/d" | sort | dmenu -i -p "Passwords")"
[ -z "$name" ] && exit