[neomutt] Misc fixes

This commit is contained in:
lara 2020-11-11 04:05:37 +01:00
parent 25f19e2607
commit 1f1fa8a5d1
5 changed files with 23 additions and 15 deletions

View file

@ -18,7 +18,7 @@ if [ -e "$LOCKFILE" ] && kill -0 "$(cat "$LOCKFILE")"; then
fi fi
# make sure the lockfile is removed when we exit and then claim it # make sure the lockfile is removed when we exit and then claim it
trap "rm -f $LOCKFILE; exit" INT TERM EXIT trap "rm -f '$LOCKFILE'; exit" INT TERM EXIT
echo $$ > "$LOCKFILE" echo $$ > "$LOCKFILE"
# Try a single short sync to test password availability # Try a single short sync to test password availability

View file

@ -65,7 +65,7 @@ unignore Organization X-Label X-Mailer User-Agent
# Compose # # Compose #
########### ###########
# https://www.zigg.com/2018/natalie-nguyen.html # https://www.zigg.com/2018/natalie-nguyen.html
my_hdr X-Clacks-Overhead: GNU Natalie Nguyen, Terry Pratchett my_hdr X-Clacks-Overhead: GNU Laura, Natalie Nguyen, Terry Pratchett
set use_from # set a From: header set use_from # set a From: header
set use_envelope_from # which from? set use_envelope_from # which from?
set sig_dashes # dashes before sig set sig_dashes # dashes before sig

View file

@ -2,10 +2,14 @@
# GENERAL # # GENERAL #
########### ###########
bind index,pager N search-opposite bind index,pager N search-opposite
bind index,pager \Cu half-up bind generic,index,pager \Cu half-up
bind index,pager \Cd half-down bind generic,index,pager \Cd half-down
bind index,pager g noop # required to define multikeys binds bind generic,index,pager g noop # required to define multikeys binds
bind generic,index gg first-entry
bind generic,index G last-entry
bind index,pager <tab> sync-mailbox bind index,pager <tab> sync-mailbox
macro index,pager ga "<shell-escape>mailsync<enter>" "Sync all IMAP mailboxes" macro index,pager ga "<shell-escape>mailsync<enter>" "Sync all IMAP mailboxes"
########### ###########
@ -21,8 +25,6 @@ bind index,pager B sidebar-toggle-visible # Toggle sidebar
######### #########
# INDEX # # INDEX #
######### #########
bind index gg first-entry
bind index G last-entry
bind index h noop # display-toggle-weed is rubbish in index view bind index h noop # display-toggle-weed is rubbish in index view
bind index l display-message bind index l display-message
bind index p recall-message bind index p recall-message
@ -57,8 +59,7 @@ macro pager gu "<pipe-message> urlscan <enter>"
########## ##########
# ATTACH # # ATTACH #
########## ##########
# http://stevelosh.com/blog/2012/10/the-homely-mutt/ bind attach l view-text # Force viewing as text
bind attach l view-mailcap
########### ###########
# NOTMUCH # # NOTMUCH #
@ -82,7 +83,7 @@ bind compose P pgp-menu
########### ###########
# Browser # # Browser #
########### ###########
bind browser l select-entry bind browser l descend-directory
bind browser h goto-parent bind browser h goto-parent
# vim: syntax=neomuttrc # vim: syntax=neomuttrc

View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
usage() { usage() {
>&2 echo "$0 <neomutt \$folder>" >&2 echo "$0 <maildirs \$folder>"
>&2 echo " Generate neomutt mailboxes & named-mailboxes for every maildir in \$folder" >&2 echo " Generate neomutt mailboxes & named-mailboxes for every maildir in \$folder"
exit 1 exit 1
} }
@ -12,11 +12,18 @@ fi
maildir="$1" maildir="$1"
mailboxes=$(find "$maildir" -mindepth 1 -maxdepth 1 -type d ! -name cur ! -name tmp ! -name new ! -name .notmuch) mailboxes=$(find "$maildir" -mindepth 1 -maxdepth 1 -type d ! -name cur ! -name tmp ! -name new ! -name .notmuch | sort)
# Order of the keys to use for the account switch macro
chars="1234567890azertyuiopqsdfghjklmwxcvbn"
i=1
for m in $mailboxes; do for m in $mailboxes; do
inbox="$(find "$m" -maxdepth 1 -iname "inbox" -type d -printf "%f" -quit)" inbox="$(find "$m" -maxdepth 1 -iname "inbox" -type d -printf "%f" -quit)"
echo "named-mailboxes '$(basename "$m")' '$m/$inbox'" key="$(printf '%s' "$chars" | cut -c "$i")"
printf "named-mailboxes '[%s] %s' '%s'\n" "$key" "$(basename "$m")" "$m/$inbox"
printf "sidebar_whitelist '%s'\n" "$m/$inbox"
printf "mailboxes " printf "mailboxes "
find "$m" -mindepth 1 -type d ! -name cur ! -name tmp ! -name new -printf '"%p"\0' | xargs -0 find "$m" -mindepth 1 -type d ! -name cur ! -name tmp ! -name new -printf '"%p"\0' | xargs -0
i=$((i+1))
done done

View file

@ -1,9 +1,9 @@
set sidebar_visible set sidebar_visible
set mail_check_stats # update unread/flagged/total counts set mail_check_stats # update unread/flagged/total counts
set sidebar_format = '%B%?F? [%!]?%* %?N?%N/?%?S?%S?' set sidebar_format = '%D%?F? [%!]?%* %?N?%N/?%?S?%S?'
set sidebar_width = 32 # Note: some chars take two columns (chinese) set sidebar_width = 32 # Note: some chars take two columns (chinese)
set sidebar_short_path # Keep only end of mailbox path set sidebar_short_path # Keep only end of mailbox path
set sidebar_component_depth = 0 # nb of parent subdirs to hide set sidebar_component_depth = 1 # nb of parent subdirs to hide
set sidebar_delim_chars = '/.' # mailbox path sep, '.' is used with IMAP set sidebar_delim_chars = '/.' # mailbox path sep, '.' is used with IMAP
set sidebar_divider_char = '|' # UI separator bar char set sidebar_divider_char = '|' # UI separator bar char
set sidebar_folder_indent # indent according to path tree set sidebar_folder_indent # indent according to path tree