diff --git a/mail-notify.bash b/mail-notify.bash index 2aa8250..790ac04 100755 --- a/mail-notify.bash +++ b/mail-notify.bash @@ -4,6 +4,7 @@ # Settings MAILDIRNEW="$HOME/Downloads/Mail/*/INBOX/new/" TMPFILE="/tmp/mail-notify.stat" +SOUNDFILE="$HOME/.local/share/sounds/mail-received.wav" # run mail sync @@ -28,9 +29,15 @@ MAILNEW="$(find $MAILDIRNEW -type f | wc -l)" # Notify if [ $MAILNEW -gt 0 ] then + # Send text if [ $MAILNEW -gt 1 ]; then notify-send -a "Mail" -c "email.arrived" -i "mail-message-new" "Neue E‑Mails" "$MAILNEW neue E‑Mails sind eingetroffen!" else notify-send -a "Mail" -c "email.arrived" -i "mail-message-new" "Neue E‑Mails" "$MAILNEW neue E‑Mail ist eingetroffen!" fi + + # Play sound + if [ -e "$SOUNDFILE" ]; then + paplay "$SOUNDFILE" + fi fi