mail-notify.bash: play sound notification
This commit is contained in:
parent
fc8417a670
commit
cbab2e5a1b
1 changed files with 7 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue