From 3fbcb3d6120bc405d90a8c0a3626b5966932600f Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Mon, 20 Dec 2021 19:07:36 +0100 Subject: [PATCH] Change weird variable substitution --- .local/bin/passwords | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.local/bin/passwords b/.local/bin/passwords index ca0c077a..d583ea82 100644 --- a/.local/bin/passwords +++ b/.local/bin/passwords @@ -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