From 9ddb824cc0ac8ec886b8a24e7edc94c210485d24 Mon Sep 17 00:00:00 2001 From: Varun Iyer Date: Tue, 23 Feb 2021 09:47:33 -0800 Subject: [PATCH 1/2] Add ucsb.edu to domains.csv --- share/domains.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/share/domains.csv b/share/domains.csv index b33772f..ed7f666 100644 --- a/share/domains.csv +++ b/share/domains.csv @@ -266,6 +266,7 @@ txstate.edu,outlook.office365.com,993,smtp.office365.com,587 ua.pt,outlook.office365.com,993,mail.ua.pt,25 uach.mx,imap.gmail.com,993,smtp.gmail.com,587 ucdavis.edu,imap.gmail.com,993,smtp.gmail.com,587 +ucsb.edu,imap.gmail.com,993,smtp.gmail.com,587 uni-duesseldorf.de,mail.hhu.de,993,mail.hhu.de,465 uni-jena.de,imap.uni-jena.de,993,smtp.uni-jena.de,587 unilodz.eu,outlook.office365.com,993,smtp.office365.com,587 From 747af1cccbfbb99fae3661c49b5ad2ccf3d3c493 Mon Sep 17 00:00:00 2001 From: Kr1ss Date: Thu, 25 Feb 2021 17:23:11 +0100 Subject: [PATCH 2/2] mailsync/notify-send: provide a default `$DISPLAY` A user reports notifications not working on their setup because there is no display id contained in the `ps`/`pgrep` output concerning the Xorg process. This commit checks if there's a display server running at all, and if so it sends notifications even if there's no display id. Resolves https://github.com/LukeSmithxyz/mutt-wizard/issues/661 --- bin/mailsync | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 6741804..ba0a4b5 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -39,12 +39,14 @@ case "$(uname)" in messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\"" ;} ;; *) - displays="$(pgrep -a X\(org\|wayland\) | grep -wo "[0-9]*:[0-9]\+" | sort -u)" - notify() { for x in $displays; do + # remember if a display server is running since `ps` doesn't always contain a display + pgrepoutput="$(pgrep -a X\(org\|wayland\))" + displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | sort -u)" + notify() { [ -n "$pgrepoutput" ] && for x in ${displays:-0:}; do export DISPLAY=$x notify-send --app-name="mutt-wizard" "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." done ;} - messageinfo() { for x in $displays; do + messageinfo() { [ -n "$pgrepoutput" ] && for x in ${displays:-0:}; do export DISPLAY=$x notify-send --app-name="mutt-wizard" "📧$from:" "$subject" done ;}