Selaa lähdekoodia

Merge branch 'insanerwayner-nonnotifyoption'

pull/891/head
Luke Smith 2 vuotta sitten
vanhempi
commit
aa5139abfc
2 muutettua tiedostoa jossa 9 lisäystä ja 4 poistoa
  1. +1
    -1
      README.md
  2. +8
    -3
      bin/mailsync

+ 1
- 1
README.md Näytä tiedosto

@@ -10,7 +10,7 @@ Get this great stuff without effort:
the internet
* make backups
- Provides a `mailsync` script that can be scheduled to run as often as you
like, which downloads/syncs mail and notifies you when new mail has arrived.
like, which downloads/syncs mail and optionally notifies you when new mail has arrived.

Specifically, this wizard:



+ 8
- 3
bin/mailsync Näytä tiedosto

@@ -19,7 +19,7 @@ pgrep mbsync >/dev/null && { echo "mbsync is already running."; exit ;}
# files for variable assignments. This is ugly, but there are few options that
# will work on the maximum number of machines.
eval "$(grep -h -- \
"^\s*\(export \)\?\(MBSYNCRC\|MPOPRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\)=" \
"^\s*\(export \)\?\(MBSYNCRC\|MPOPRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\|MAILSYNC_MUTE\)=" \
"$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \
"$HOME/.config/zsh/.zshenv" "$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" \
"$HOME/.pam_environment" 2>/dev/null)"
@@ -31,8 +31,13 @@ export GPG_TTY="$(tty)"

lastrun="${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun"

# Mute notifications or get kernel name.
# Settings are different for MacOS (Darwin) systems.
case "$(uname)" in
[ -z "$MAILSYNC_MUTE" ] && notify="$(uname)" || notify="mute"
case "$notify" in
mute)
notify() { : ;}
;;
Darwin)
notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;}
;;
@@ -56,7 +61,7 @@ syncandnotify() {
if [ "$1" = "pop" ]; then
# Handle POP
mpop "$acc"
else
else
# Handle IMAP
if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi
fi


Ladataan…
Peruuta
Tallenna