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"
|
totp_tmp="${XDG_CACHE_HOME:-$HOME/.cache}/totp-tmp.png"
|
||||||
|
|
||||||
passwordList() { \
|
passwordList() {
|
||||||
prefix=${PASSWORD_STORE_DIR-~/.password-store}
|
prefix=${PASSWORD_STORE_DIR-~/.password-store}
|
||||||
|
|
||||||
password_files=("$prefix"/**/*.gpg)
|
password_files=("$prefix"/**/*.gpg)
|
||||||
@ -13,13 +13,12 @@ passwordList() { \
|
|||||||
password_files=$(printf '%s\n' "${password_files[@]}")
|
password_files=$(printf '%s\n' "${password_files[@]}")
|
||||||
}
|
}
|
||||||
|
|
||||||
getPasswords() { \
|
getPasswords() {
|
||||||
choice="$(echo "$password_files" | grep -v "totp" | dmenu -i -p "Passwords")"
|
choice="$(echo "$password_files" | grep -v "totp" | dmenu -i -p "Passwords")"
|
||||||
|
|
||||||
[ -z "$choice" ] && exit
|
[ -z "$choice" ] && exit
|
||||||
|
|
||||||
pass -c "$choice"
|
pass -c "$choice" && notify-send "📋 Password for $choice copied!"
|
||||||
notify-send "📋 Password for $choice copied!"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getTOTP() {
|
getTOTP() {
|
||||||
@ -27,11 +26,10 @@ getTOTP() {
|
|||||||
|
|
||||||
[ -z "$choice" ] && exit
|
[ -z "$choice" ] && exit
|
||||||
|
|
||||||
pass otp -c "$choice"
|
pass otp -c "$choice" && notify-send "📋 OTP for $choice copied!"
|
||||||
notify-send "📋 OTP for $choice copied!"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addTOTP() { \
|
addTOTP() {
|
||||||
ifinstalled zbarimg || exit
|
ifinstalled zbarimg || exit
|
||||||
|
|
||||||
name=$(printf "" | dmenu -i -p "What is the account name?")
|
name=$(printf "" | dmenu -i -p "What is the account name?")
|
||||||
@ -46,7 +44,7 @@ addTOTP() { \
|
|||||||
rm "$totp_tmp"
|
rm "$totp_tmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
addPassword() { \
|
addPassword() {
|
||||||
name=$(printf "" | dmenu -i -p "What is the account name?")
|
name=$(printf "" | dmenu -i -p "What is the account name?")
|
||||||
|
|
||||||
[ -z "$name" ] && exit
|
[ -z "$name" ] && exit
|
||||||
@ -63,7 +61,7 @@ addPassword() { \
|
|||||||
notify-send "🔒 Password for $name added!"
|
notify-send "🔒 Password for $name added!"
|
||||||
}
|
}
|
||||||
|
|
||||||
removePassword() { \
|
removePassword() {
|
||||||
name="$(pass | echo "$password_files" | dmenu -i -p "Passwords")"
|
name="$(pass | echo "$password_files" | dmenu -i -p "Passwords")"
|
||||||
|
|
||||||
[ -z "$name" ] && exit
|
[ -z "$name" ] && exit
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user