Skip to content

Instantly share code, notes, and snippets.

@liuw
Created March 18, 2019 13:45
Show Gist options
  • Save liuw/cf60c32c78d5e23f7215b3b39119c889 to your computer and use it in GitHub Desktop.
Save liuw/cf60c32c78d5e23f7215b3b39119c889 to your computer and use it in GitHub Desktop.
A script to show a pop-up for new mail
#!/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