aboutsummaryrefslogtreecommitdiff
path: root/mail-checknow
blob: 188042b0e79c0ad5bb15c8f3ca738546bb74df44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

# Check for new email, save result to file.
# Requires: mpop, notify-send or similar

file="$XDG_DATA_HOME/newmail"
#notify="notify-send"
notify=herbe

l=$(cat "$file")
n=$(mpop -s | awk '/new*./{print $2}')

if [ -n "$n" ]; then
	echo "$n" > "$file"
	if [ "$n" != "no" ] && [ "$l" != "$n" ]; then
		$notify "New email ($n)"
	fi
fi

Generated with cgit - Back to sebastiano.tronto.net