From ff57bd2eb785ea393fd569751c47b93339af7861 Mon Sep 17 00:00:00 2001 From: Wayne Reeves Date: Fri, 8 Nov 2019 19:01:41 -0600 Subject: Fix Malformed UTF-8 Character in Mailsync fixes #322 (#323) * line 5 defined the variable DBUS_SESSION_BUS_ADDRESS before exporting it in the next line * change the pgrep line * Revert "Update domains.csv (#321)" This reverts commit a92c01e13121f42b9f9b8962ae2c07b0a0ce5d4d. * Revert "Revert "Update domains.csv (#321)"" This reverts commit af0c0826b9a699780256dc8492e74a157cab2a85. * Revert "line 5 defined the variable DBUS_SESSION_BUS_ADDRESS before exporting it in the next line" This reverts commit ca64a6ae56a31ead28cc638d8d8dac7e28f9df68. * Revert "Revert "line 5 defined the variable DBUS_SESSION_BUS_ADDRESS before exporting it in the next line"" This reverts commit 4304eb731c109289251e06ef86377d372cef07e4. --- bin/mailsync | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bin/mailsync') diff --git a/bin/mailsync b/bin/mailsync index d79507d..c56ccb2 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -2,12 +2,13 @@ # Sync mail and give notification if there is new mail. export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus +DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus +export DBUS_SESSION_BUS_ADDRESS export DISPLAY=:0.0 [ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" # Run only if user logged in (prevent cron errors) -pgrep -u "$USER" >/dev/null || { echo "$USER not logged in; sync will not run."; exit ;} +pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync will not run."; exit ;} # Run only if not already running in other instance pgrep -x mbsync >/dev/null && { echo "mbsync is already running." ; exit ;} -- cgit v1.2.3 From 6aa28a56b1d9b027a48feb26dc4c45bc829e5d65 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 23 Nov 2019 19:23:27 -0500 Subject: STATUSBAR matching LARBS changes --- bin/mailsync | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/mailsync') diff --git a/bin/mailsync b/bin/mailsync index c56ccb2..212a97c 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -48,7 +48,7 @@ else fi echo " 🔃" > /tmp/imapsyncicon_"$USER" -pkill -RTMIN+12 i3blocks >/dev/null 2>&1 +pkill -RTMIN+12 "$STATUSBAR" >/dev/null 2>&1 # Parallelize multiple accounts for account in $accounts @@ -58,7 +58,7 @@ done wait rm -f /tmp/imapsyncicon_"$USER" -pkill -RTMIN+12 i3blocks >/dev/null 2>&1 +pkill -RTMIN+12 "$STATUSBAR" >/dev/null 2>&1 notmuch new 2>/dev/null -- cgit v1.2.3 From 3fee819bfe39449687fa1ad038e9df914c7247da Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 24 Nov 2019 07:42:08 -0500 Subject: fix if STATUSBAR not set --- bin/mailsync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/mailsync') diff --git a/bin/mailsync b/bin/mailsync index 212a97c..f0b62ea 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -48,7 +48,7 @@ else fi echo " 🔃" > /tmp/imapsyncicon_"$USER" -pkill -RTMIN+12 "$STATUSBAR" >/dev/null 2>&1 +pkill -RTMIN+12 "${STATUSBAR:?}" >/dev/null 2>&1 # Parallelize multiple accounts for account in $accounts -- cgit v1.2.3 From 7698abb0f9fc236b578e3ec6caa31867de019c6e Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 24 Nov 2019 07:44:23 -0500 Subject: lol fix other --- bin/mailsync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/mailsync') diff --git a/bin/mailsync b/bin/mailsync index f0b62ea..f7c3211 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -58,7 +58,7 @@ done wait rm -f /tmp/imapsyncicon_"$USER" -pkill -RTMIN+12 "$STATUSBAR" >/dev/null 2>&1 +pkill -RTMIN+12 "${STATUSBAR:?}" >/dev/null 2>&1 notmuch new 2>/dev/null -- cgit v1.2.3 From dfdc3162bafa4abebcb91106085aaf4f575db57d Mon Sep 17 00:00:00 2001 From: Ole Martin Ruud Date: Wed, 27 Nov 2019 14:16:37 +0100 Subject: Add app name to notify-send invocation (#324) This enables users to easily recognize notifications to be able to modify or style them through notification daemons. --- bin/mailsync | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/mailsync') diff --git a/bin/mailsync b/bin/mailsync index f7c3211..2cec271 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -20,7 +20,7 @@ command -v notify-send >/dev/null || echo "Note that \`libnotify\` or \`libnotif if [ "$(uname)" = "Darwin" ]; then notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;} else - notify() { notify-send "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." ;} + notify() { notify-send --app-name="mutt-wizard" "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." ;} fi # Check account for new mail. Notify if there is new content. @@ -35,7 +35,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 "📧$from:" "$subject" & + notify-send --app-name="mutt-wizard" "📧$from:" "$subject" & done fi } -- cgit v1.2.3