diff --git a/src/.config/fish/aliases.fish b/src/.config/fish/aliases.fish index 7ca66b1..90e0704 100644 --- a/src/.config/fish/aliases.fish +++ b/src/.config/fish/aliases.fish @@ -15,6 +15,7 @@ end # Neomutt configs function neomutt.local; neomutt -F .config/neomutt/neomuttrc.local; end function neomutt.disroot; neomutt -F .config/neomutt/neomuttrc.disroot; end +function neomutt.work; neomutt -F .config/neomutt/neomuttrc.work; end # Specific to my Gentoo system function genlop; doas -u portage /usr/bin/genlop; end diff --git a/src/.config/neomutt/gmail-common.muttrc b/src/.config/neomutt/gmail-common.muttrc new file mode 100644 index 0000000..acc83ba --- /dev/null +++ b/src/.config/neomutt/gmail-common.muttrc @@ -0,0 +1,19 @@ +# vim: filetype=muttrc + +set smtp_pass="$imap_pass" +set smtp_authenticators = 'login' + +set folder="imaps://imap.gmail.com/" +set spoolfile=+INBOX +set record="+[Gmail]/Sent Mail" +set postponed="+[Gmail]/Drafts" +mailboxes =INBOX =[Gmail]/Sent\ Mail =[Gmail]/All\ Mail =[Gmail]/Starred =[Gmail]/Drafts =[Gmail]/Spam =[Gmail]/Trash + +macro index ga "=[Gmail]/All Mail" "Go to all mail" +macro index gd "=[Gmail]/Drafts" "Go to drafts" +macro index gi "=INBOX" "Go to inbox" +macro index gs "=[Gmail]/Starred" "Go to starred messages" +macro index gS "=[Gmail]/Sent Mail" "Go to sent messages" +macro index gt "=[Gmail]/Trash" "Go to trash" +macro index,pager d "=[Gmail]/Trash" "Trash" +macro index,pager y "=[Gmail]/All Mail" "Archive" diff --git a/src/.config/neomutt/gmail-work.muttrc b/src/.config/neomutt/gmail-work.muttrc new file mode 100644 index 0000000..0d15763 --- /dev/null +++ b/src/.config/neomutt/gmail-work.muttrc @@ -0,0 +1,10 @@ +# vim: filetype=muttrc + +set from="$ID_EMAIL_WORK" +set realname="$ID_REALNAME" + +set imap_user="$ID_EMAIL_WORK" +set imap_pass="`keepassxc-cli show -s -a neomutt \"$KEEPASSDB\" work/gmail`" +set smtp_url="smtps://$ID_EMAIL_WORK_USER@smtp.gmail.com/" + +source ~/.config/neomutt/gmail-common.muttrc diff --git a/src/.config/neomutt/gmail.muttrc b/src/.config/neomutt/gmail.muttrc index 246ad31..77b66dc 100644 --- a/src/.config/neomutt/gmail.muttrc +++ b/src/.config/neomutt/gmail.muttrc @@ -5,22 +5,6 @@ set realname="$ID_REALNAME" set imap_user="$ID_EMAIL" set imap_pass="`keepassxc-cli show -s -a neomutt \"$KEEPASSDB\" meta/gmail`" - set smtp_url="smtps://$ID_EMAIL_USER@smtp.gmail.com/" -set smtp_pass="$imap_pass" -set smtp_authenticators = 'login' -set folder="imaps://imap.gmail.com/" -set spoolfile=+INBOX -set record="+[Gmail]/Sent Mail" -set postponed="+[Gmail]/Drafts" -mailboxes =INBOX =[Gmail]/Sent\ Mail =[Gmail]/All\ Mail =[Gmail]/Starred =[Gmail]/Drafts =[Gmail]/Spam =[Gmail]/Trash - -macro index ga "=[Gmail]/All Mail" "Go to all mail" -macro index gd "=[Gmail]/Drafts" "Go to drafts" -macro index gi "=INBOX" "Go to inbox" -macro index gs "=[Gmail]/Starred" "Go to starred messages" -macro index gS "=[Gmail]/Sent Mail" "Go to sent messages" -macro index gt "=[Gmail]/Trash" "Go to trash" -macro index,pager d "=[Gmail]/Trash" "Trash" -macro index,pager y "=[Gmail]/All Mail" "Archive" +source ~/.config/neomutt/gmail-common.muttrc diff --git a/src/.config/neomutt/neomuttrc.work b/src/.config/neomutt/neomuttrc.work new file mode 100644 index 0000000..27c265e --- /dev/null +++ b/src/.config/neomutt/neomuttrc.work @@ -0,0 +1,2 @@ +source ~/.config/neomutt/common.muttrc +source ~/.config/neomutt/gmail-work.muttrc diff --git a/src/.local/bin/identity.sh b/src/.local/bin/identity.sh index 67e03fd..d488aa5 100755 --- a/src/.local/bin/identity.sh +++ b/src/.local/bin/identity.sh @@ -16,11 +16,13 @@ fields=$(mktemp) cat << "EOF" > "$fields" export ID_REALNAME= export ID_EMAIL= +export ID_EMAIL_WORK= EOF -keepassxc-cli show "$KEEPASSDB" meta/identity -a realname -a email | paste -d '' "$fields" - >> "$IDFILE" +keepassxc-cli show "$KEEPASSDB" meta/identity -a realname -a email -a email-work | paste -d '' "$fields" - >> "$IDFILE" rm "$fields" cat << "EOF" >> "$IDFILE" export ID_EMAIL_USER=$(basename "$ID_EMAIL" @gmail.com) +export ID_EMAIL_WORK_USER=$(basename "$ID_EMAIL_WORK" @gmail.com) EOF