Browse Source

Merge branch 'dev' into gentoo

mail: enhance scan for new mail
gentoo
David JULIEN 5 months ago
parent
commit
2e3eaef75e
Signed by: swytch
GPG Key ID: 4B388E8BD9D47382
  1. 3
      .config/mutt/muttrc
  2. 2
      .local/bin/mailsync
  3. 2
      .local/bin/statusbar/sb-mailbox

3
.config/mutt/muttrc

@ -1,7 +1,6 @@
# vim: filetype=neomuttrc
source /home/swytch/.config/mutt/neomutt.muttrc
source /home/swytch/.config/mutt/accounts/1-david.julien@posteo.net.muttrc
macro index,pager i1 '<sync-mailbox><enter-command>source /home/swytch/.config/mutt/accounts/1-david.julien@posteo.net.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to david.julien@posteo.net"
source /home/swytch/.config/mutt/accounts/2-david.julien@ens-lyon.fr.muttrc
macro index,pager i2 '<sync-mailbox><enter-command>source /home/swytch/.config/mutt/accounts/2-david.julien@ens-lyon.fr.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to david.julien@ens-lyon.fr"
macro index,pager i3 '<sync-mailbox><enter-command>source /home/swytch/.config/mutt/accounts/3-david.julien@mailo.com.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to david.julien@mailto.com"
source /home/swytch/.config/mutt/accounts/2-david.julien@ens-lyon.fr.muttrc

2
.local/bin/mailsync

@ -40,7 +40,7 @@ messageinfo() {
syncandnotify() {
acc="$(echo "$account" | sed "s/.*\///")"
mbsync "$acc"
new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc/[Ii][Nn][Bb][Oo][Xx]/new/* -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2>/dev/null)"
new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc/*/new/ -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" | grep -iv "trash" 2>/dev/null)"
newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l)
if [ "$newcount" -gt "0" ]; then
for file in $new; do

2
.local/bin/statusbar/sb-mailbox

@ -13,7 +13,7 @@
unread=""
for acc in $(ls "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/)
do
new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc/*/new/ -type f | grep -iv "trash" | wc -l 2>/dev/null)"
if [ $new -gt 0 ]; then
[ -n "$(echo "$acc" | sed -n '/@ens/p')" ] && box=""
[ -n "$(echo "$acc" | sed -n '/@mailo/p')" ] && box=""

Loading…
Cancel
Save