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

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

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

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