From 7c75eebe62a40acccacecf6da7b04b753545c980 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Fri, 28 Oct 2022 09:27:09 +0200 Subject: [PATCH] Feat: configure neomutt, khard and vdirsyncer --- neomutt/.config/khard/khard.conf | 51 +++++++++++++++ neomutt/.config/neomutt/accounts/ac-lyon | 26 ++++++++ neomutt/.config/neomutt/accounts/bb_opytex | 26 ++++++++ neomutt/.config/neomutt/colors | 23 +++++++ neomutt/.config/neomutt/mailcap | 12 ++++ neomutt/.config/neomutt/mappings | 55 +++++++++++++++++ neomutt/.config/neomutt/neomuttrc | 11 ++++ neomutt/.config/neomutt/settings | 72 ++++++++++++++++++++++ neomutt/.config/vdirsyncer/config | 21 +++++++ 9 files changed, 297 insertions(+) create mode 100644 neomutt/.config/khard/khard.conf create mode 100644 neomutt/.config/neomutt/accounts/ac-lyon create mode 100644 neomutt/.config/neomutt/accounts/bb_opytex create mode 100644 neomutt/.config/neomutt/colors create mode 100644 neomutt/.config/neomutt/mailcap create mode 100644 neomutt/.config/neomutt/mappings create mode 100644 neomutt/.config/neomutt/neomuttrc create mode 100644 neomutt/.config/neomutt/settings create mode 100644 neomutt/.config/vdirsyncer/config diff --git a/neomutt/.config/khard/khard.conf b/neomutt/.config/khard/khard.conf new file mode 100644 index 0000000..a627717 --- /dev/null +++ b/neomutt/.config/khard/khard.conf @@ -0,0 +1,51 @@ +# example configuration file for khard version > 0.14.0 +# place it under ~/.config/khard/khard.conf +# This file is parsed by the configobj library. The syntax is described at +# https://configobj.readthedocs.io/en/latest/configobj.html#the-config-file-format + +[addressbooks] +[[contacts]] +path = ~/.contacts/contacts/ + +[general] +debug = no +default_action = list +# These are either strings or comma seperated lists +editor = nvim, -i, NONE +merge_editor = vimdiff + +[contact table] +# display names by first or last name: first_name / last_name / formatted_name +display = first_name +# group by address book: yes / no +group_by_addressbook = no +# reverse table ordering: yes / no +reverse = no +# append nicknames to name column: yes / no +show_nicknames = no +# show uid table column: yes / no +show_uids = yes +# sort by first or last name: first_name / last_name / formatted_name +sort = last_name +# localize dates: yes / no +localize_dates = yes +# set a comma separated list of preferred phone number types in descending priority +# or nothing for non-filtered alphabetical order +preferred_phone_number_type = pref, cell, home +# set a comma separated list of preferred email address types in descending priority +# or nothing for non-filtered alphabetical order +preferred_email_address_type = pref, work, home + +[vcard] +# extend contacts with your own private objects +# these objects are stored with a leading "X-" before the object name in the vcard files +# every object label may only contain letters, digits and the - character +# example: +# private_objects = Jabber, Skype, Twitter +# default: , (the empty list) +# preferred vcard version: 3.0 / 4.0 +preferred_version = 4.0 +# Look into source vcf files to speed up search queries: yes / no +search_in_source_files = no +# skip unparsable vcard files: yes / no +skip_unparsable = no diff --git a/neomutt/.config/neomutt/accounts/ac-lyon b/neomutt/.config/neomutt/accounts/ac-lyon new file mode 100644 index 0000000..6b05d80 --- /dev/null +++ b/neomutt/.config/neomutt/accounts/ac-lyon @@ -0,0 +1,26 @@ +# vim: filetype=muttrc +unmailboxes * + +set my_pass = "`pass Prof/pronote/bbertrand`" +set folder = "imaps://mail.ac-lyon.fr" +set imap_user = bbertrand +set imap_pass = $my_pass + +set ssl_force_tls = yes +set smtp_url = smtps://$imap_user@smtps.ac-lyon.fr:587 +set smtp_pass = $my_pass +set ssl_starttls = yes +set smtp_authenticators = "login" + +set from = "benjamin.bertrand@ac-lyon.fr" + +set spoolfile = +INBOX +mailboxes = +INBOX +set imap_check_subscribed + +set record = "+Sent" +set trash = "+Trash" +set postponed = "+Drafts" + +## Hook -- IMPORTANT! +account-hook $folder "set imap_pass=`pass Prof/pronote/bbertrand`" diff --git a/neomutt/.config/neomutt/accounts/bb_opytex b/neomutt/.config/neomutt/accounts/bb_opytex new file mode 100644 index 0000000..06ed7a7 --- /dev/null +++ b/neomutt/.config/neomutt/accounts/bb_opytex @@ -0,0 +1,26 @@ +# vim: filetype=muttrc +unmailboxes * + +set my_pass = "`pass mail/mailfence/Takanuva`" +set folder = "imaps://imap.mailfence.com/" +set imap_user = Takanuva +set imap_pass = $my_pass + +set ssl_force_tls = yes +set smtp_url = smtps://$imap_user@smtp.mailfence.com:465 +set smtp_pass = $my_pass +set ssl_starttls = yes +set smtp_authenticators = "login" + +set from = "benjamin.bertrand@opytex.org" + +set spoolfile = +INBOX +set imap_check_subscribed + +set record = "+Sent" +set trash = "+Trash" +set postponed = "+Drafts" + + +## Hook -- IMPORTANT! +account-hook $folder "set imap_pass=`pass mail/mailfence/Takanuva`" diff --git a/neomutt/.config/neomutt/colors b/neomutt/.config/neomutt/colors new file mode 100644 index 0000000..39b16b2 --- /dev/null +++ b/neomutt/.config/neomutt/colors @@ -0,0 +1,23 @@ +# -*-muttrc-*- + +# Palette for use with the Linux console. Black background. + +color hdrdefault blue black +color quoted blue black +color signature blue black +color attachment red black +color prompt brightmagenta black +color message brightred black +color error brightred black +color indicator black red +color status brightgreen blue +color tree white black +color normal white black +color markers red black +color search white black +color tilde brightmagenta black +color index blue black ~F +color index red black "~N|~O" + +# color body brightwhite black '\*+[^*]+\*+' +# color body brightwhite black '_+[^_]+_+' diff --git a/neomutt/.config/neomutt/mailcap b/neomutt/.config/neomutt/mailcap new file mode 100644 index 0000000..f0e4c22 --- /dev/null +++ b/neomutt/.config/neomutt/mailcap @@ -0,0 +1,12 @@ +# xdg-open +application/msword; /usr/bin/xdg-open %s +application/pdf; /usr/bin/xdg-open %s +application/postscript ; /usr/bin/xdg-open %s + +# HTML +text/html; w3m -I %{charset} -T text/html; copiousoutput; +text/plain; nvim %s + +#Images +image/png; /usr/bin/vimiv %s +image/jpeg; /usr/bin/vimiv %s diff --git a/neomutt/.config/neomutt/mappings b/neomutt/.config/neomutt/mappings new file mode 100644 index 0000000..4e38f28 --- /dev/null +++ b/neomutt/.config/neomutt/mappings @@ -0,0 +1,55 @@ +# vim: filetype=muttrc + +# sidebar mappings +bind index,pager \Ck sidebar-prev +bind index,pager \Cj sidebar-next +bind index,pager \Co sidebar-open +bind index,pager \Cp sidebar-prev-new +bind index,pager \Cn sidebar-next-new +bind index,pager B sidebar-toggle-visible + +# global index and pager shortcuts +bind index,pager @ compose-to-sender +bind index,pager D purge-message +bind index sync-mailbox +bind index collapse-thread + +# Email completion bindings +bind editor complete-query +bind editor ^T complete + + +# General rebindings +bind attach view-mailcap +bind attach l view-mailcap +bind editor noop +bind pager c imap-fetch-mail +bind index G last-entry +bind index g noop +bind index gg first-entry +bind pager,attach h exit +bind pager j next-line +bind pager k previous-line +bind pager l view-attachments +bind index D delete-message +bind index U undelete-message +bind index L limit +bind index h noop +bind index l display-message +bind browser h goto-parent +bind browser l select-entry +bind pager,browser gg top-page +bind pager,browser G bottom-page +bind index,pager,browser d half-down +bind index,pager,browser u half-up +bind index,pager R group-reply +bind index \031 previous-undeleted # Mouse wheel +bind index \005 next-undeleted # Mouse wheel +bind pager \031 previous-line # Mouse wheel +bind pager \005 next-line # Mouse wheel +bind editor complete-query +# +## Shortcuts +macro index,pager 'source ~/.config/neomutt/accounts/ac-lyon!' +macro index,pager 'source ~/.config/neomutt/accounts/bb_opytex!' + diff --git a/neomutt/.config/neomutt/neomuttrc b/neomutt/.config/neomutt/neomuttrc new file mode 100644 index 0000000..7b4ff68 --- /dev/null +++ b/neomutt/.config/neomutt/neomuttrc @@ -0,0 +1,11 @@ +# vim: filetype=muttrc + +source ~/.config/neomutt/settings +source ~/.config/neomutt/colors +source ~/.config/neomutt/mappings + + +source ~/.config/neomutt/accounts/ac-lyon +folder-hook $folder 'source ~/.config/neomutt/accounts/ac-lyon' +source ~/.config/neomutt/accounts/bb_opytex +folder-hook $folder 'source ~/.config/neomutt/accounts/bb_opytex' diff --git a/neomutt/.config/neomutt/settings b/neomutt/.config/neomutt/settings new file mode 100644 index 0000000..1921408 --- /dev/null +++ b/neomutt/.config/neomutt/settings @@ -0,0 +1,72 @@ +# vim: filetype=muttrc + +set editor = "nvim" + +set realname = "Benjamin Bertrand" +set use_from = "yes" + +# How often to check for new mail (time in seconds). +set mail_check = 120 + +# Allow Mutt to open a new IMAP connection automatically. +unset imap_passive + +# Keep the IMAP connection alive by polling intermittently (time in seconds). +set imap_keepalive = 300 + +# main options +set envelope_from +set edit_headers # show headers when composing +set fast_reply # skip to compose when replying +set askcc # ask for CC: +set fcc_attach # save attachments with the body +set forward_format = "Fwd: %s" # format of subject when forwarding +set forward_decode # decode when forwarding +set attribution = "On %d, %n wrote:" # format of quoting header +set reply_to # reply to Reply to: field +set reverse_name # reply as whomever it was to +set include # include message in replies +set forward_quote # include message in forwards +set text_flowed +unset sig_dashes # no dashes before sig +unset mime_forward # forward attachments as part of body +unset help # No help bar at the top of index +# set status_on_top # Status bar on top of index +set tmpdir = ~/Programs/neomutt/temp # where to keep temp files + + + +# status bar, date format, finding stuff etc. +set status_chars = " *%A" +set status_format = "[ Folder: %f ] [%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]%>─%?p?( %p postponed )?" +set date_format = "%d.%m.%Y %H:%M" +set sort = threads +set sort_aux = reverse-last-date-received +set uncollapse_jump +set sort_re +set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*" +set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+" +set send_charset = "utf-8:iso-8859-1:us-ascii" +set charset = "utf-8" +set arrow_cursor = "no" # Change `color indicator` depending + + +# Pager View Options +set pager_index_lines = 20 # Shows 10 lines of index when pager is active +set pager_context = 3 +set pager_stop +set menu_scroll +set tilde +unset markers + +# Mailcal for attachments +set mailcap_path = ~/.config/neomutt/mailcap +set header_cache = "~/.cache/mutt" +set message_cachedir = "~/.cache/mutt" + +# Contact with khard +set query_command = "khard email --parsable --search-in-source-files '%s'" + +# Set preffered view modes +auto_view text/html text/calendar application/ics # view html automatically +alternative_order text/html text/plain text/enriched text/* diff --git a/neomutt/.config/vdirsyncer/config b/neomutt/.config/vdirsyncer/config new file mode 100644 index 0000000..7e907a8 --- /dev/null +++ b/neomutt/.config/vdirsyncer/config @@ -0,0 +1,21 @@ +[general] +status_path = "~/.config/vdirsyncer/status/" + +[pair cloud_opytex_contact] +a = "cloud_opytex_contact_local" +b = "cloud_opytex_contact_remote" +collections = ["from a", "from b"] +conflict_resolution = "b wins" + +[storage cloud_opytex_contact_local] +type = "filesystem" +path = "~/.contacts/" +fileext = ".vcf" + +[storage cloud_opytex_contact_remote] +type = "carddav" + +# We can simplify this URL here as well. In theory it shouldn't matter. +url = "https://cloud.poneyworld.net/remote.php/dav/addressbooks/users/lafrite/contacts/" +username = "lafrite" +password.fetch = ["command", "pass", "OVH/Panais/docker/cloud.poneyworld.net/lafrite"]