From: martin f. krafft Date: Wed, 29 Mar 2023 08:16:01 +0000 (+0200) Subject: use offlineimap mailboxes order X-Git-Url: https://git.madduck.net/etc/mutt.git/commitdiff_plain/23c9ed5dea01349dd7c978265ad2dd2c53bc53e1?ds=sidebyside;hp=3f2ef4be00de46a9ce966d3412f0d1313c6b4e69 use offlineimap mailboxes order --- diff --git a/.config/mutt/list-mailboxes b/.config/mutt/list-mailboxes index 497a253..d0bb5d5 100755 --- a/.config/mutt/list-mailboxes +++ b/.config/mutt/list-mailboxes @@ -1,6 +1,15 @@ #!/bin/sh +if [ -f $VARDIR/offlineimap/mailboxes ]; then + sed 1d $VARDIR/offlineimap/mailboxes +fi + find "$1/" -type d -name cur -printf '%h\n' | \ sed -e "s,^$1/,=,g" -e "s,^$1\$,$2," | \ - egrep -v '^=(sp(ool|am)|discard|retrain(/(sp|h)am)?)$' | \ - sort | xargs echo mailboxes + egrep -v '^=(sp(ool|am)|discard|retrain(/(sp|h)am)?)$' | sort | \ +while read mailbox; do + + ! grep -q "^mailboxes ${mailbox}\$" $VARDIR/offlineimap/mailboxes || continue + echo "mailboxes $mailbox" + +done