mailcap and mwrc global

This commit is contained in:
Luke Smith 2019-04-22 14:21:40 -04:00
parent 1d57f265b2
commit 34501199f3
No known key found for this signature in database
GPG Key ID: 4C50B54A911F6252
2 changed files with 3 additions and 5 deletions

6
bin/mw
View File

@ -9,7 +9,7 @@ emailre=".\+@.\+\\..\+" # Regex to confirm valid email address
muttshare="/usr/share/mutt-wizard" muttshare="/usr/share/mutt-wizard"
mbsyncrc="$HOME/.mbsyncrc" mbsyncrc="$HOME/.mbsyncrc"
sslcert="/etc/ssl/certs/ca-certificates.crt" sslcert="/etc/ssl/certs/ca-certificates.crt"
mwconfig="$muttdir/mutt-wizard.muttrc" mwconfig="/usr/share/mutt-wizard/mutt-wizard.muttrc"
muttrc="$muttdir/muttrc" muttrc="$muttdir/muttrc"
getaccounts() { accounts="$(find "$accdir" -type f | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /g;s/\..*//" | sort -n)" ;} getaccounts() { accounts="$(find "$accdir" -type f | grep -o "[0-9]-.*.muttrc" | sed "s/-/: /g;s/\..*//" | sort -n)" ;}
@ -260,13 +260,11 @@ asktype() { while : ; do
init() { mkdir -p "$muttdir" "$accdir" init() { mkdir -p "$muttdir" "$accdir"
[ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" && echo "muttrc created." [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" && echo "muttrc created."
cp -f "$muttshare/mailcap" "$muttdir" && echo "Mailcap file added."
cp -f "$muttshare/mutt-wizard.muttrc" "$muttdir" && echo "mutt-wizard config file added."
! grep "^source.*mutt-wizard.muttrc" "$muttrc" >/dev/null && echo "source $mwconfig # mw-autogenerated" >> "$muttrc" && echo "muttrc will now source mutt-wizard." ! grep "^source.*mutt-wizard.muttrc" "$muttrc" >/dev/null && echo "source $mwconfig # mw-autogenerated" >> "$muttrc" && echo "muttrc will now source mutt-wizard."
} }
purge() { confirm "delete all account data" || exit purge() { confirm "delete all account data" || exit
rm -rf "$mbsyncrc" "$accdir" "$mwconfig" "$HOME/.config/msmtp" "$mwconfig" rm -rf "$mbsyncrc" "$accdir" "$HOME/.config/msmtp"
echo "All configs and account settings have been purged." echo "All configs and account settings have been purged."
sed -i "/\# mw-autogenerated/d" "$muttrc" sed -i "/\# mw-autogenerated/d" "$muttrc"
} }

View File

@ -3,7 +3,7 @@
# mutt-wizard will have this file sourced from your muttrc. # mutt-wizard will have this file sourced from your muttrc.
# In the interest of seamless updating, do not edit this file. # In the interest of seamless updating, do not edit this file.
# If you want to override any settings, set those in your muttrc. # If you want to override any settings, set those in your muttrc.
set mailcap_path = ~/.config/mutt/mailcap set mailcap_path = /usr/share/mutt-wizard/mailcap
set date_format="%y/%m/%d %I:%M%p" set date_format="%y/%m/%d %I:%M%p"
set index_format="%2C %zs %?X?A& ? %D %-15.15F %s (%-4.4c)" set index_format="%2C %zs %?X?A& ? %D %-15.15F %s (%-4.4c)"
set sort = 'reverse-date' set sort = 'reverse-date'