scripts

Utilitity scripts
git clone git://gtms.dev:scripts
Log | Files | Refs

commit 27a665a8c5f3ba2ccc57e7c62a87f86d05d2abc8
parent 0ed44a333cbc1e8994d3a9211660fc7879a4abc5
Author: Tomas Nemec <nemi@skaut.cz>
Date:   Tue,  7 Feb 2023 22:34:31 +0100

update

Diffstat:
Mmail_count.lua | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/mail_count.lua b/mail_count.lua @@ -1,7 +1,15 @@ #!/bin/lua -local mbsync = require('tms.mbsync') -local acc = mbsync.accounts() +-- List accounts inside mbsyncrc +local accounts = function() + local acc = {} + for a in io.popen('cat ~/.mbsyncrc | sed -n \'s/^Group //p\''):lines() do + table.insert(acc, a) + end + return acc +end + +local acc = accounts() local function count(a) local h = io.popen(string.format('fd . %s/.mail/%s/INBOX/new | wc -l', os.getenv('HOME'), a))