From 7c7c01ea76d4d2a93397514f36f57ddded5f9247 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 6 Nov 2021 01:15:25 -0700 Subject: [polybar] Show the total number of unread emails --- polybar/usr/bin/count-emails | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 polybar/usr/bin/count-emails (limited to 'polybar/usr') diff --git a/polybar/usr/bin/count-emails b/polybar/usr/bin/count-emails new file mode 100755 index 0000000..98a2573 --- /dev/null +++ b/polybar/usr/bin/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.2.3-54-g00ecf