From 45d1380289c577f1a04c8117ff36ff374d82023c Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 14 Sep 2023 23:34:03 +0200 Subject: eww: Add a widget for email --- .config/eww/scripts/email-listener | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 .config/eww/scripts/email-listener (limited to '.config/eww/scripts') diff --git a/.config/eww/scripts/email-listener b/.config/eww/scripts/email-listener new file mode 100755 index 0000000..c205025 --- /dev/null +++ b/.config/eww/scripts/email-listener @@ -0,0 +1,28 @@ +#!/bin/sh + +count() +{ + x=`find "$MAILDIR"/*/Inbox/new -type f | wc -l` + case $x in + 0) + echo 'No New Mail' + ;; + 1) + echo '1 New Mail' + ;; + *) + printf '%d New Mails\n' $x + ;; + esac +} + +count +inotifywait -qm "$MAILDIR"/*/Inbox/new | while read _ event _ +do + case "$event" in + CREATE|DELETE|MOVED_*) + count + ;; + esac +done +#'' -- cgit v1.2.3