dotfiles/polybar/usr/bin/count-emails

15 lines
414 B
Scheme
Executable file

#!/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))