aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas <nbnoll@eml.cc>2021-12-01 19:59:59 -0800
committerNicholas <nbnoll@eml.cc>2021-12-01 19:59:59 -0800
commit905adfa6349d8bafbfbf90af1590cd5ff26c7886 (patch)
tree1232ee6928bc7a41038f877906ff795f12044db3
parent138fb272fae79587de3469493b55e4d18eadc722 (diff)
fix: group email
-rwxr-xr-xbin/email10
-rwxr-xr-xbin/status6
2 files changed, 8 insertions, 8 deletions
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