commit fb96f8b19a0d5997c220098700f5b9f8b78d0cb3
parent a58417a2267b68fafff086b267a87d174a8edd82
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Fri, 6 Apr 2018 14:37:12 -0400
Fix status parsing of mailboxes with multiple monitored directories
Diffstat:
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/links/bin/mailstatus.sh b/links/bin/mailstatus.sh
@@ -5,7 +5,8 @@ if [ ! -d $maildir ]; then
fi
newmails=$(find $maildir/*/{INBOX,geodatahub}/new -type f)
numbernewmails=$(echo $newmails | wc -w | sed 's/ *//')
-mailboxes="$(echo $newmails | tr ' ' '\n' | sed 's/.*Mail\///' | sed 's/\/INBOX.*//')"
+mailboxes="$(echo $newmails | tr ' ' '\n' | sed 's/.*Mail\///' |
+ sed 's/\/INBOX.*//' | sed 's/adamsgaard\/geodatahub.*/geodatahub/')"
mailcolor="#859900"
debug=false
@@ -14,11 +15,10 @@ offlineimap=/usr/local/bin/offlineimap
accounts=""
if [[ $mailboxes == *"adamsgaard"* ]]; then
- if [[ $mailboxes == *"geodatahub"* ]]; then
- accounts="${accounts}G"
- else
- accounts="${accounts}a"
- fi
+ accounts="${accounts}a"
+fi
+if [[ $mailboxes == *"geodatahub"* ]]; then
+ accounts="${accounts}G"
fi
if [[ $mailboxes == *"princeton"* ]]; then
accounts="${accounts}p"
diff --git a/misc_code/bitbar-plugins/mail.5s.sh b/misc_code/bitbar-plugins/mail.5s.sh
@@ -5,7 +5,8 @@ if [ ! -d $maildir ]; then
fi
newmails=$(find $maildir/*/{INBOX,geodatahub}/new -type f)
numbernewmails=$(echo $newmails | wc -w | sed 's/ *//')
-mailboxes="$(echo $newmails | tr ' ' '\n' | sed 's/.*Mail\///' | sed 's/\/INBOX.*//')"
+mailboxes="$(echo $newmails | tr ' ' '\n' | sed 's/.*Mail\///' |
+ sed 's/\/INBOX.*//' | sed 's/adamsgaard\/geodatahub.*/geodatahub/')"
mailcolor="#859900"
debug=false
@@ -14,11 +15,10 @@ offlineimap=/usr/local/bin/offlineimap
accounts=""
if [[ $mailboxes == *"adamsgaard"* ]]; then
- if [[ $mailboxes == *"geodatahub"* ]]; then
- accounts="${accounts}G"
- else
- accounts="${accounts}a"
- fi
+ accounts="${accounts}a"
+fi
+if [[ $mailboxes == *"geodatahub"* ]]; then
+ accounts="${accounts}G"
fi
if [[ $mailboxes == *"princeton"* ]]; then
accounts="${accounts}p"