소스 검색

feat(mailsync): open email notify-send action

pull/1023/head
Sander 10 달 전
committed by GitHub
부모
커밋
c224d29547
No known key found for this signature in database GPG 키 ID: B5690EEEBB952194
1개의 변경된 파일14개의 추가작업 그리고 1개의 파일을 삭제
  1. +14
    -1
      bin/mailsync

+ 14
- 1
bin/mailsync 파일 보기

@@ -80,7 +80,20 @@ syncandnotify() {
from="$(sed -n "/^From:/ s|From: *|| p" "$file" |
perl -CS -MEncode -ne 'print decode("MIME-Header", $_)')"
from="${from% *}" ; from="${from%\"}" ; from="${from#\"}"
notify "📧$from:" "$subject"
message_id=$(sed -n 's/^Message-ID: *\(<.*>\)$/\1/p' "$file")
ACTION=$(notify "📧$from:" "$subject" --action="open=Open email" "📧$from:" "$subject")
case "$ACTION" in
open)
if [ -n "$message_id" ]; then
$TERMINAL -e neomutt -f "$XDG_DATA_HOME/mail/$2/INBOX" -e "'push L~i$message_id\n\n'"
else
$TERMINAL -e neomutt -f "$XDG_DATA_HOME/mail/$2/INBOX"
fi
;;
*)
echo "No valid action selected"
;;
esac
done
;;
*) echo "No new mail for $2." ;;


불러오는 중...
취소
저장