Bladeren bron

new mail info for macos

tags/v3.1
Luke Smith 4 jaren geleden
bovenliggende
commit
946abe8f5f
Geen bekende sleutel gevonden voor deze handtekening in de database GPG sleutel-ID: 4C50B54A911F6252
1 gewijzigde bestanden met toevoegingen van 3 en 1 verwijderingen
  1. +3
    -1
      bin/mailsync

+ 3
- 1
bin/mailsync Bestand weergeven

@@ -21,8 +21,10 @@ export DISPLAY=:0.0
# Settings are different for MacOS (Darwin) systems.
if [ "$(uname)" = "Darwin" ]; then
notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;}
messageinfo() { osascript "display notification with title \"📧 $from\" subtitle \"$subject\"" ;}
else
notify() { notify-send --app-name="mutt-wizard" "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." ;}
messageinfo() { notify-send --app-name="mutt-wizard" "📧$from:" "$subject" ;}
fi

# Check account for new mail. Notify if there is new content.
@@ -37,7 +39,7 @@ syncandnotify() {
# Extract subject and sender from mail.
from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//')
subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n-1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n')
notify-send --app-name="mutt-wizard" "📧$from:" "$subject" &
messageinfo &
done
fi
}


Laden…
Annuleren
Opslaan