aboutsummaryrefslogtreecommitdiffstats
path: root/polybar/usr/bin/count-emails
blob: 98a257332f2c21dda988917e64039651ec122534 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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))