From 9befbb9c7940c8acf62de947788a0c81e4eb9691 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 6 Nov 2021 01:15:25 -0700 Subject: Show the total number of unread emails --- count-emails | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 count-emails diff --git a/count-emails b/count-emails new file mode 100755 index 0000000..98a2573 --- /dev/null +++ b/count-emails @@ -0,0 +1,15 @@ +#!/usr/bin/env -S scsh -s +;; -*- mode: scheme; -*- +!# + +(define mail-root (string-append (getenv "HOME") "/documents/mail")) + +(define unread-emails + (run/sexp (pipe (find ,mail-root -type f -name "*:2,*" -and -not -name "*:2,*S*") + (wc -l)))) + +(define new-emails + (run/sexp (pipe (find ,mail-root -type f -wholename "*/new/*") + (wc -l)))) + +(display (+ unread-emails new-emails)) -- cgit v1.3-2-g0d8e