only osd if notify-send exists

This commit is contained in:
tavo-wasd 2023-06-28 20:17:19 -06:00
parent cd11b7c0da
commit 0d10b0d48d
2 changed files with 2 additions and 2 deletions

View file

@ -11,5 +11,5 @@ password=$(find ~/.password-store/ -type f -name '*.gpg' | sed 's/.*\/\(.*\)\.gp
pass otp "$password" | while read -r OUTPUT; do
echo $OUTPUT | xsel -ib
xdotool type "$OUTPUT"
notify-send " $password" "$OUTPUT"
[ -e /usr/bin/notify-send ] && notify-send " $password" "$OUTPUT"
done

View file

@ -10,4 +10,4 @@ password=$(find ~/.password-store/ -type f -name '*.gpg' |
# If chosen, use xdotool to type it
pass=$(pass show "$password" | head -1)
xdotool type "$pass" && notify-send " $password" "Successfully decrypted"
xdotool type "$pass" && [ -e /usr/bin/notify-send ] && notify-send " $password" "Successfully decrypted"