From cbab2e5a1b502cceb145f126353da53c5d5ec370 Mon Sep 17 00:00:00 2001 From: coderkun Date: Wed, 27 Jul 2016 19:18:44 +0200 Subject: [PATCH] mail-notify.bash: play sound notification --- mail-notify.bash | 7 +++++++ 1 file changed, 7 insertions(+) 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