diff options
author | Luke Smith <luke@lukesmith.xyz> | 2021-09-23 12:59:15 -0400 |
---|---|---|
committer | Luke Smith <luke@lukesmith.xyz> | 2021-09-23 12:59:15 -0400 |
commit | 8d177222d6d07ada68930a64a0f7a2e320817094 (patch) | |
tree | f236e91a7b4c390e05a18925c67fc033bc9084cb /bin | |
parent | f845e11fe281dd144311ff619cf16388a0f636e3 (diff) |
don't show message info anymore
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/mailsync | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/bin/mailsync b/bin/mailsync index 4469d55..bed86a9 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -33,7 +33,6 @@ export GPG_TTY="$(tty)" case "$(uname)" in Darwin) notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;} - messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\"" ;} ;; *) case "$(readlink -f /sbin/init)" in @@ -46,10 +45,6 @@ case "$(uname)" in export DISPLAY=$x notify-send --app-name="mutt-wizard" "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." done ;} - messageinfo() { [ -n "$pgrepoutput" ] && for x in ${displays:-0:}; do - export DISPLAY=$x - notify-send --app-name="mutt-wizard" "📧$from:" "$subject" - done ;} ;; esac @@ -67,13 +62,7 @@ syncandnotify() { -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2> /dev/null) newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l) case 1 in - $((newcount > 5)) ) notify "$acc" "$newcount" ;; - $((newcount > 0)) ) for file in $new; do - # 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') - messageinfo & - done ;; + $((newcount > 0)) ) notify "$acc" "$newcount" ;; esac } |