summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Smith <Luke Smith>2022-07-01 09:48:15 -0400
committerLuke Smith <Luke Smith>2022-07-01 09:48:15 -0400
commit9db5d1b4fc2bdc3d541016b7750f64eaa2afac51 (patch)
treec5a16178d7cd250f5642aea25fda0b357ff32615
parentef5bac2b55e3bd665d103eff4ea435ecaa9db22c (diff)
parent367c10ec3f16c3c11e1a5de980bc95dd4fa6bf79 (diff)
Merge branch 'master' of https://github.com/wrigleyster/mutt-wizard into wrigleyster-master
-rwxr-xr-xbin/mailsync7
-rwxr-xr-xbin/mw2
2 files changed, 4 insertions, 5 deletions
diff --git a/bin/mailsync b/bin/mailsync
index 2f32c14..6aba835 100755
--- a/bin/mailsync
+++ b/bin/mailsync
@@ -70,14 +70,13 @@ syncandnotify() {
}
# Sync accounts passed as argument or all.
-if [ "$#" -eq "0" ]; then
- accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")"
-else
+if [ "$#" -gt "0" ]; then
for arg in "$@"; do
[ "${arg%${arg#?}}" = '-' ] && opts="${opts:+${opts} }${arg}" && shift 1
done
accounts=$*
fi
+[[ ! $accounts ]] && accounts="$(awk '/^Channel/ {print $2}' "$MBSYNCRC")"
# Parallelize multiple accounts
for account in $accounts; do
@@ -86,7 +85,7 @@ done
wait
-notmuch new 2>/dev/null
+notmuch new --quiet
#Create a touch file that indicates the time of the last run of mailsync
touch "$lastrun"
diff --git a/bin/mw b/bin/mw
index f0b46e2..c71d662 100755
--- a/bin/mw
+++ b/bin/mw
@@ -262,7 +262,7 @@ togglecron() { cron="$(mktemp)"
sed -ibu /mailsync/d "$cron"; rm -f "$cron"bu
else
echo "Adding automatic mailsync every ${cronmin:-10} minutes..."
- echo "*/${cronmin-10} * * * * $prefix/bin/mailsync" >> "$cron"
+ echo "*/${cronmin:-10} * * * * $prefix/bin/mailsync -q" >> "$cron"
fi &&
crontab "$cron"; rm -f "$cron" ;}