浏览代码

mailsync: Check whether XDG_CONFIG_HOME is defined before defaulting to $HOME/.config for mutt dir

tags/3.2.1
dgrisham 3 年前
父节点
当前提交
b11dcf53dc
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. +4
    -2
      bin/mailsync

+ 4
- 2
bin/mailsync 查看文件

@@ -33,6 +33,8 @@ case "$(readlink -f /sbin/init)" in
esac
export GPG_TTY=$TTY

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

[ -n "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" || MBSYNCRC="$HOME/.mbsyncrc"

# Settings are different for MacOS (Darwin) systems.
@@ -58,7 +60,7 @@ esac
syncandnotify() {
acc="$(echo "$account" | sed "s/.*\///")"
if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi
new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "$HOME/.config/mutt/.mailsynclastrun" 2> /dev/null)
new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "$muttconfig/.mailsynclastrun" 2> /dev/null)
newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l)
if [ "$newcount" -gt "0" ]; then
notify "$acc" "$newcount" &
@@ -91,4 +93,4 @@ wait
notmuch new 2>/dev/null

#Create a touch file that indicates the time of the last run of mailsync
touch "$HOME/.config/mutt/.mailsynclastrun"
touch "$muttconfig/.mailsynclastrun"

正在加载...
取消
保存