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
|
# Settings
|
||||||
MAILDIRNEW="$HOME/Downloads/Mail/*/INBOX/new/"
|
MAILDIRNEW="$HOME/Downloads/Mail/*/INBOX/new/"
|
||||||
TMPFILE="/tmp/mail-notify.stat"
|
TMPFILE="/tmp/mail-notify.stat"
|
||||||
|
SOUNDFILE="$HOME/.local/share/sounds/mail-received.wav"
|
||||||
|
|
||||||
|
|
||||||
# run mail sync
|
# run mail sync
|
||||||
|
|
@ -28,9 +29,15 @@ MAILNEW="$(find $MAILDIRNEW -type f | wc -l)"
|
||||||
# Notify
|
# Notify
|
||||||
if [ $MAILNEW -gt 0 ]
|
if [ $MAILNEW -gt 0 ]
|
||||||
then
|
then
|
||||||
|
# Send text
|
||||||
if [ $MAILNEW -gt 1 ]; then
|
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!"
|
notify-send -a "Mail" -c "email.arrived" -i "mail-message-new" "Neue E‑Mails" "$MAILNEW neue E‑Mails sind eingetroffen!"
|
||||||
else
|
else
|
||||||
notify-send -a "Mail" -c "email.arrived" -i "mail-message-new" "Neue E‑Mails" "$MAILNEW neue E‑Mail ist eingetroffen!"
|
notify-send -a "Mail" -c "email.arrived" -i "mail-message-new" "Neue E‑Mails" "$MAILNEW neue E‑Mail ist eingetroffen!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Play sound
|
||||||
|
if [ -e "$SOUNDFILE" ]; then
|
||||||
|
paplay "$SOUNDFILE"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue