From 905adfa6349d8bafbfbf90af1590cd5ff26c7886 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 1 Dec 2021 19:59:59 -0800 Subject: fix: group email --- bin/email | 10 +++++----- bin/status | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'bin') diff --git a/bin/email b/bin/email index efe3906..3f5994c 100755 --- a/bin/email +++ b/bin/email @@ -57,19 +57,19 @@ def send(account, to): input = sys.stdin.read() email = mail(input) - cmd = run([mstmp, "-a", account, "--", to], input=email) + cmd = run([mstmp, "-a", account, "--"] + to, input=email) if cmd.returncode != 0: raise ValueError(f"did not send mail. err={cmd.returncode}") if __name__ == "__main__": - if len(sys.argv) != 4: - raise ArgumentError(f"invalid usage: recieved arguments {sys.argv[1:]}") + if len(sys.argv) < 4: + raise TypeError(f"invalid usage: recieved arguments {sys.argv[1:]}") account = sys.argv[1] if sys.argv[2] != "--": - raise ArgumentError(f"invalid usage: received {sys.argv[2:]} instead of recipient") + raise TypeError(f"invalid usage: received {sys.argv[2:]} instead of recipient") - to = sys.argv[3] + to = sys.argv[3:] send(account, to) diff --git a/bin/status b/bin/status index 9643e39..df787a1 100755 --- a/bin/status +++ b/bin/status @@ -7,7 +7,7 @@ cpu() { } mail() { - NEWMAIL=$(expr $(ls -1 ~/mail/*/INBOX/new | wc -l) - 7) + NEWMAIL=$(expr $(ls -1 ~/mail/*/INBOX/new | wc -l) - 5) if [ "${NEWMAIL%% *}" -eq 0 ]; then printf " (%s)" "${NEWMAIL%% *}" @@ -71,7 +71,7 @@ ipaddr() { } dostatus() { - exec xsetroot -name "$VOL│$MEM│$IP│$CPU│$NML│$WTR│$TIM" & + exec xsetroot -name "$VOL│$MEM│$BAT|$IP│$CPU│$NML│$WTR│$TIM" & } # signal handlers @@ -145,6 +145,6 @@ do refresh_cpu refresh_mail refresh_time - dostatus & + dostatus sleep 1m & wait $! done -- cgit v1.2.1