Created
March 18, 2019 13:45
-
-
Save liuw/cf60c32c78d5e23f7215b3b39119c889 to your computer and use it in GitHub Desktop.
A script to show a pop-up for new mail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Depends on notify-send. Invoked from MDA (fetchmail etc). | |
while IFS= read -r line; do | |
#header="$header$line\n" | |
if [[ x$line = "xSubject:"* ]]; then | |
subject="$line" | |
fi | |
if [[ x$line = "xFrom:"* ]]; then | |
from="$line" | |
fi | |
done | |
DISPLAY=:0 /usr/bin/notify-send "$from $subject" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment