From 469b6ff8faa9d52311f5afbd8979649c4468e30b Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Sat, 19 Sep 2020 14:05:14 +0300 Subject: Change location of mbsync, notmuch config files --- dotfiles/.local/bin/mailsync | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'dotfiles/.local') diff --git a/dotfiles/.local/bin/mailsync b/dotfiles/.local/bin/mailsync index 431d314..2c70f27 100755 --- a/dotfiles/.local/bin/mailsync +++ b/dotfiles/.local/bin/mailsync @@ -1,6 +1,10 @@ #!/bin/sh # Sync mail and give notification if there is new mail. +# Config files +notmuchrc="$XDG_CONFIG_HOME/notmuchrc" +mbsyncrc="$XDG_CONFIG_HOME/mbsyncrc" + # Run only if user logged in (prevent cron errors) w | grep "^$USER\W" >/dev/null || exit @@ -18,9 +22,9 @@ thereis=0 # Run mbsync. You can feed this script different settings. if [ $# -eq 0 ]; then - mbsync -a + mbsync -c "$mbsyncrc" -a else - mbsync "$@" + mbsync -c "$mbsyncrc" "$@" fi # Check all accounts/mailboxes for new mail. Notify if there is new content. @@ -35,11 +39,11 @@ do done if [ $thereis = 1 ]; then - mpv "$HOME/.local/share/soundalerts/mail.mp3" > /dev/null + mpv --really-quiet "$HOME/.local/share/soundalerts/mail.mp3" killall -43 waybar fi -notmuch new 2>/dev/null +notmuch -c "$notmuchrc" new 2>/dev/null # Create a touch file that indicates the time of the last run of mailsync touch "$HOME/.cache/lastmailsync" -- cgit v1.2.3