mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Only notify when successfully copying password
This commit is contained in:
parent
039f6147b6
commit
bb755b367b
@ -4,7 +4,7 @@ shopt -s nullglob globstar
|
||||
|
||||
totp_tmp="${XDG_CACHE_HOME:-$HOME/.cache}/totp-tmp.png"
|
||||
|
||||
passwordList() { \
|
||||
passwordList() {
|
||||
prefix=${PASSWORD_STORE_DIR-~/.password-store}
|
||||
|
||||
password_files=("$prefix"/**/*.gpg)
|
||||
@ -13,13 +13,12 @@ passwordList() { \
|
||||
password_files=$(printf '%s\n' "${password_files[@]}")
|
||||
}
|
||||
|
||||
getPasswords() { \
|
||||
getPasswords() {
|
||||
choice="$(echo "$password_files" | grep -v "totp" | dmenu -i -p "Passwords")"
|
||||
|
||||
[ -z "$choice" ] && exit
|
||||
|
||||
pass -c "$choice"
|
||||
notify-send "📋 Password for $choice copied!"
|
||||
pass -c "$choice" && notify-send "📋 Password for $choice copied!"
|
||||
}
|
||||
|
||||
getTOTP() {
|
||||
@ -27,11 +26,10 @@ getTOTP() {
|
||||
|
||||
[ -z "$choice" ] && exit
|
||||
|
||||
pass otp -c "$choice"
|
||||
notify-send "📋 OTP for $choice copied!"
|
||||
pass otp -c "$choice" && notify-send "📋 OTP for $choice copied!"
|
||||
}
|
||||
|
||||
addTOTP() { \
|
||||
addTOTP() {
|
||||
ifinstalled zbarimg || exit
|
||||
|
||||
name=$(printf "" | dmenu -i -p "What is the account name?")
|
||||
@ -46,7 +44,7 @@ addTOTP() { \
|
||||
rm "$totp_tmp"
|
||||
}
|
||||
|
||||
addPassword() { \
|
||||
addPassword() {
|
||||
name=$(printf "" | dmenu -i -p "What is the account name?")
|
||||
|
||||
[ -z "$name" ] && exit
|
||||
@ -63,7 +61,7 @@ addPassword() { \
|
||||
notify-send "🔒 Password for $name added!"
|
||||
}
|
||||
|
||||
removePassword() { \
|
||||
removePassword() {
|
||||
name="$(pass | echo "$password_files" | dmenu -i -p "Passwords")"
|
||||
|
||||
[ -z "$name" ] && exit
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user