mail-notify.bash: play sound notification

This commit is contained in:
coderkun 2016-07-27 19:18:44 +02:00
commit cbab2e5a1b

View file

@ -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 EMails" "$MAILNEW neue EMails sind eingetroffen!"
else
notify-send -a "Mail" -c "email.arrived" -i "mail-message-new" "Neue EMails" "$MAILNEW neue EMail ist eingetroffen!"
fi
# Play sound
if [ -e "$SOUNDFILE" ]; then
paplay "$SOUNDFILE"
fi
fi