From c3aa6733f2cb723523598f4ad6b6b49d82849c1e Mon Sep 17 00:00:00 2001
From: Aaron Friesen <maugrift@maugrift.com>
Date: Sun, 24 Jan 2021 15:39:51 -0600
Subject: Fix duplicate mailsync notifications

---
 bin/mailsync | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'bin/mailsync')

diff --git a/bin/mailsync b/bin/mailsync
index 42cd4e0..dfcd7da 100755
--- a/bin/mailsync
+++ b/bin/mailsync
@@ -44,7 +44,7 @@ case "$(uname)" in
 		messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\"" ;}
 		;;
 	*)
-		displays="$(pgrep -a Xorg | grep -wo "[0-9]*:[0-9]\+")"
+		displays="$(pgrep -a Xorg | grep -wo "[0-9]*:[0-9]\+" | uniq)"
 	    	notify() { for x in $displays; do
 				export DISPLAY=$x
 				notify-send --app-name="mutt-wizard" "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account."
-- 
cgit v1.2.3