diff options
| -rw-r--r-- | .gitignore | 3 | ||||
| -rwxr-xr-x | mutt_install.sh | 9 | ||||
| -rw-r--r-- | muttrc | 11 | ||||
| -rw-r--r-- | personal.muttrc | 8 | ||||
| -rwxr-xr-x | wipe_settings.sh | 12 | 
5 files changed, 30 insertions, 13 deletions
| @@ -1,4 +1,5 @@ +*.swp  *.gpg -*.muttrc  accounts/  *.pyc +personal.muttrc diff --git a/mutt_install.sh b/mutt_install.sh index 9813470..0f97abe 100755 --- a/mutt_install.sh +++ b/mutt_install.sh @@ -64,11 +64,12 @@ replacement="  	/$delet/d"  # Gets the first unused shortcut number in the muttrc and puts it in $idnum. -cat "$muttdir"muttrc | grep i[0-9] | awk '{print $3}' | sed -e 's/i//g' > /tmp/mutt_used +cat "$muttdir"personal.muttrc | grep i[0-9] | awk '{print $3}' | sed -e 's/i//g' > /tmp/mutt_used  echo -e "1\n2\n3\n4\n5\n6\n7\n8\n9" > /tmp/mutt_all_possible  idnum=$(diff /tmp/mutt_all_possible /tmp/mutt_used | sed -n 2p | awk '{print $2}')  addAccount() { +	mkdir -p "$muttdir"accounts/  	# First, adding the encrypted password.  	dialog --title "Luke's mutt/offlineIMAP password wizard" --passwordbox "Enter the password for the \"$title\" account." 10 60 2> /tmp/$title  	gpg -r $youremail --encrypt /tmp/$title @@ -82,7 +83,7 @@ addAccount() {  	# Add the mutt profile.  	cat "$muttdir"autoconf/mutt_profile | sed -e "$replacement" > "$muttdir"accounts/$title.muttrc  	# Add a numbered shortcut in the muttrc -	echo "macro index,pager i$idnum '<sync-mailbox><enter-command>source "$muttdir"accounts/$title.muttrc<enter><change-folder>!<enter>'" >> "$muttdir"muttrc +	echo "macro index,pager i$idnum '<sync-mailbox><enter-command>source "$muttdir"accounts/$title.muttrc<enter><change-folder>!<enter>'" >> "$muttdir"personal.muttrc  	# Adding directory structure for cache.  	mkdir -p "$muttdir"accounts/$title/cache/bodies "$muttdir"accounts/$title/cache/headers @@ -91,8 +92,8 @@ addAccount() {  	sed -i "s/^accounts =.*[a-zA-Z]$/&, $title/g;s/^accounts =$/accounts = $title/g" ~/.offlineimaprc  	# Makes account default if there is no default account. -	grep "$muttdir"muttrc -e "^source .*accounts.*" >/dev/null && echo there || \ -	echo "source ${muttdir}accounts/$title.muttrc" >> "$muttdir"muttrc ;} +	grep "$muttdir"personal.muttrc -e "^source .*accounts.*" >/dev/null && echo there || \ +	echo "source ${muttdir}accounts/$title.muttrc" >> "$muttdir"personal.muttrc ;}  addAccount  clear @@ -1,6 +1,9 @@  # vim: filetype=muttrc  # This is the general mutt config which has the settings that all accounts use.  source etc/muttcol +bind index,pager i noop +bind index,pager g noop +source personal.muttrc  set sleep_time = 0  set sort = 'reverse-date'  set editor = vim @@ -12,8 +15,6 @@ set date_format="%m/%d %I:%M"  set index_format="%2C %Z %D %-15.15F %s (%-4.4c)"  set markers = no  set mark_old = no -bind index,pager i noop -bind index,pager g noop  auto_view text/html  auto_view application/pdf  alternative_order text/plain text/enriched text/html @@ -44,9 +45,3 @@ macro index,pager \Cu |urlview\n  bind index \Cf noop  macro index \Cf "<enter-command>unset wait_key<enter><shell-escape>read -p 'notmuch query: ' x; echo \$x >~/.cache/mutt_terms<enter><limit>~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;chomp@a;s/\^id:// for@a;$,=\"|\";print@a'\`\"<enter>" "show only messages matching a notmuch pattern"  macro index A "<limit>all\n" "show all messages (undo limit)" -macro index,pager i1 '<sync-mailbox><enter-command>source /home/luke/.config/mutt/accounts/luke.muttrc<enter><change-folder>!<enter>' -source /home/luke/.config/mutt/accounts/luke.muttrc -macro index,pager i2 '<sync-mailbox><enter-command>source /home/luke/.config/mutt/accounts/gmail.muttrc<enter><change-folder>!<enter>' -macro index,pager i3 '<sync-mailbox><enter-command>source /home/luke/.config/mutt/accounts/gkulade.muttrc<enter><change-folder>!<enter>' -macro index,pager i4 '<sync-mailbox><enter-command>source /home/luke/.config/mutt/accounts/evenor.muttrc<enter><change-folder>!<enter>' -macro index,pager i5 '<sync-mailbox><enter-command>source /home/luke/.config/mutt/accounts/kulade.muttrc<enter><change-folder>!<enter>' diff --git a/personal.muttrc b/personal.muttrc new file mode 100644 index 0000000..67da34b --- /dev/null +++ b/personal.muttrc @@ -0,0 +1,8 @@ +# vim: filetype=muttrc + +# This file is where the wizard will output +# information on which file to treat as default +# and shortcut bindings for jumping from account to account. + +# You can edit this manually if you know what you're doing. + diff --git a/wipe_settings.sh b/wipe_settings.sh new file mode 100755 index 0000000..bfdd8b8 --- /dev/null +++ b/wipe_settings.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +muttdir="$HOME/.config/mutt/" + +wipe () { rm $HOME/.offlineimaprc +rm -rf "$muttdir"/accounts +rm -f "$muttdir"credentials/*gpg +rm "$muttdir"personal.muttrc ;} + +(dialog --defaultno --title "Wipe all custom neomutt/offlineIMAP settings?" --yesno "Would you like to wipe all of the mutt/offlineIMAP settings generated by the system?" 6 60 && wipe) || clear && exit + +clear | 
