dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit c0af0d2ac0046e070f56104579f85294a7238d36
parent 55b33aaa5272ed391c12a0b9bb2b264801b31f77
Author: Anders Damsgaard Christensen <adc@geo.au.dk>
Date:   Wed,  1 Jun 2016 13:04:22 -0700

add senders to dropdown menu

Diffstat:
Mbitbar-plugins/mail.5s.sh | 14++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/bitbar-plugins/mail.5s.sh b/bitbar-plugins/mail.5s.sh @@ -1,22 +1,28 @@ #!/bin/sh -newmails=$(find ~/Mail/*/INBOX/new -type f | wc -l | sed 's/ *//') +newmails=$(find ~/Mail/*/INBOX/new -type f) +numbernewmails=$(echo $newmails | wc -w | sed 's/ *//') mailcolor="#859900" debug=false offlineimap=/usr/local/bin/offlineimap -if [ "$newmails" -gt 0 ]; then +if [ "$numbernewmails" -gt 0 ]; then mailcolor="#cb4b16" fi -echo "M: ${newmails} | color=${mailcolor}" +echo "M: ${numbernewmails} | color=${mailcolor}" # everything below in drop down menu echo "---" -mailboxes="$(find ~/Mail/*/INBOX/new -type f | sed 's/.*Mail\///' | sed 's/\/INBOX.*//')" +mailboxes="$(echo $newmails | sed 's/.*Mail\///' | sed 's/\/INBOX.*//')" echo $mailboxes echo "---" +from="$(cat $newmails | grep 'From: ' | sed 's/From: //' | sed 's/>/>\\n/')" +echo $from + +echo "---" + echo "Sync inboxes | bash=\"$offlineimap\" param1=-qf param2=INBOX terminal=$debug" echo "Sync all | bash=\"$offlineimap\" terminal=$debug"