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 d9690762009afbaf2d14ac9a67c06b6735259d9e
parent 7bfa20fb577518a03ba5718163d81f5e489b6da9
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Sat, 15 Dec 2018 12:31:18 +0100

Fix mail formatting

Diffstat:
Mlinks/.config/i3/i3scripts/i3mail | 49++-----------------------------------------------
Mlinks/bin/mailstatus.sh | 2+-
2 files changed, 3 insertions(+), 48 deletions(-)

diff --git a/links/.config/i3/i3scripts/i3mail b/links/.config/i3/i3scripts/i3mail @@ -14,50 +14,5 @@ case $BLOCK_BUTTON in - Middle click syncs mail" ;; esac -maildir=~/mail -if [ ! -d $maildir ]; then - exit 0 -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.*//' | sed 's/adamsgaard\/geodatahub.*/geodatahub/')" - -mailcolor="#859900" -debug=false -#debug=true -offlineimap=offlineimap - -accounts="" -if [[ $mailboxes == *"adamsgaard"* ]]; then - accounts="${accounts}a" -fi -if [[ $mailboxes == *"geodatahub"* ]]; then - accounts="${accounts}G" -fi -if [[ $mailboxes == *"princeton"* ]]; then - accounts="${accounts}p" -fi -if [[ $mailboxes == *"noaa"* ]]; then - accounts="${accounts}n" -fi -if [[ $mailboxes == *"gmail"* ]]; then - accounts="${accounts}g" -fi -if [[ $mailboxes == *"geomail"* ]]; then - accounts="${accounts}e" -fi -if [[ $mailboxes == *"ucsd"* ]]; then - accounts="${accounts}u" -fi -if [[ $mailboxes == *"riseup"* ]]; then - accounts="${accounts}r" -fi - -if [ "$numbernewmails" -gt 0 ]; then - # echo "#[fg=red]M: ${numbernewmails} (${accounts})" - echo "<span color=\"red\">M: ${numbernewmails} (${accounts})</span>" -else - # echo "#[fg=green]M: ${numbernewmails}" - echo -fi +mailstatus=$(mailstatus.sh | sed 's/\#\[.*]//') +echo $mailstatus diff --git a/links/bin/mailstatus.sh b/links/bin/mailstatus.sh @@ -5,7 +5,7 @@ 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\///' | +mailboxes="$(echo $newmails | tr ' ' '\n' | sed 's/.*\/mail\///' | sed 's/\/INBOX.*//' | sed 's/adamsgaard\/geodatahub.*/geodatahub/')" mailcolor="#859900"