From b98e05ba63f2e108df634b4d9f9e5530769c6b80 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 10 Jun 2021 18:58:52 +0200 Subject: Added scripts and readme --- mail-checknow | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 mail-checknow (limited to 'mail-checknow') diff --git a/mail-checknow b/mail-checknow new file mode 100755 index 0000000..3363173 --- /dev/null +++ b/mail-checknow @@ -0,0 +1,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 -- cgit v1.3