From 03977345f97c06f63c5deb7069a66558e6dc2d4f Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 1 Mar 2017 19:16:54 +0100 Subject: [PATCH] mutt: Move config to .config/mutt, mutt.d to .local/share --- {.mutt => .config/mutt}/account-example | 2 +- {.mutt => .config/mutt}/colors.classic | 0 {.mutt => .config/mutt}/colors.fallback.sh | 0 {.mutt => .config/mutt}/colors.zenburn | 0 {.mutt => .config/mutt}/mailcap | 0 {.mutt => .config/mutt}/maileditor.sh | 0 {.mutt => .config/mutt}/muttrc | 46 +++++++++++----------- {.mutt => .config/mutt}/purgecache.sh | 0 {.mutt => .config/mutt}/sidebar.sh | 0 {.mutt => .config/mutt}/theme | 0 {.mutt => .config/mutt}/view-html.sh | 0 .scripts/homeinit | 2 +- 12 files changed, 26 insertions(+), 24 deletions(-) rename {.mutt => .config/mutt}/account-example (95%) rename {.mutt => .config/mutt}/colors.classic (100%) rename {.mutt => .config/mutt}/colors.fallback.sh (100%) rename {.mutt => .config/mutt}/colors.zenburn (100%) rename {.mutt => .config/mutt}/mailcap (100%) rename {.mutt => .config/mutt}/maileditor.sh (100%) rename {.mutt => .config/mutt}/muttrc (88%) rename {.mutt => .config/mutt}/purgecache.sh (100%) rename {.mutt => .config/mutt}/sidebar.sh (100%) rename {.mutt => .config/mutt}/theme (100%) rename {.mutt => .config/mutt}/view-html.sh (100%) diff --git a/.mutt/account-example b/.config/mutt/account-example similarity index 95% rename from .mutt/account-example rename to .config/mutt/account-example index ae6a156c..1cbacc16 100644 --- a/.mutt/account-example +++ b/.config/mutt/account-example @@ -16,7 +16,7 @@ set ssl_force_tls=yes unset ssl_starttls ## Signature with a random 'fortune'. -set signature="cat ~/.mutt/real_name && fortune -s |" +set signature="cat $my_localdir/real_name && fortune -s |" ## Sidebar mailboxes separator workaround. mailboxes "+~~~~~~~~~~~~~~~~~~~~~~~~" diff --git a/.mutt/colors.classic b/.config/mutt/colors.classic similarity index 100% rename from .mutt/colors.classic rename to .config/mutt/colors.classic diff --git a/.mutt/colors.fallback.sh b/.config/mutt/colors.fallback.sh similarity index 100% rename from .mutt/colors.fallback.sh rename to .config/mutt/colors.fallback.sh diff --git a/.mutt/colors.zenburn b/.config/mutt/colors.zenburn similarity index 100% rename from .mutt/colors.zenburn rename to .config/mutt/colors.zenburn diff --git a/.mutt/mailcap b/.config/mutt/mailcap similarity index 100% rename from .mutt/mailcap rename to .config/mutt/mailcap diff --git a/.mutt/maileditor.sh b/.config/mutt/maileditor.sh similarity index 100% rename from .mutt/maileditor.sh rename to .config/mutt/maileditor.sh diff --git a/.mutt/muttrc b/.config/mutt/muttrc similarity index 88% rename from .mutt/muttrc rename to .config/mutt/muttrc index 9522df39..ffbdd0cb 100644 --- a/.mutt/muttrc +++ b/.config/mutt/muttrc @@ -3,9 +3,13 @@ ## This configuration is made for Mutt with embedded IMAP support. ## These folders are assumed to exist: -## ~/.mutt.d: personal stuff (contacts, account information). -## ~/.mutt: public stuff (config, theme, mailcap). -## ~/.cache/mutt: cache for headers and messages. +## Cache for headers and messages: +set header_cache=~/.cache/mutt/headers +set message_cachedir=~/.cache/mutt/messages +## Public data (config, theme, mailcap): +set my_configdir=~/.config/mutt +## personal data (contacts, account information): +set my_localdir=~/.local/share/mutt ################################################################################ ## General options. @@ -24,7 +28,7 @@ set pgp_timeout=3600 set edit_headers=yes ## Set EDITOR dynamically. -source "~/.mutt/maileditor.sh|" +source "$my_configdir/maileditor.sh|" ## Don't ask for recipient. We usually don't want to include mail unless we want ## to quote it. @@ -35,9 +39,7 @@ set include_onlyfirst=yes ## Store message headers locally to speed things up. Gentoo wiki says that if a ## folder is specified, it is even faster. If no folder exists, the cache will ## be a single file. -set header_cache=~/.cache/mutt/headers -set message_cachedir=~/.cache/mutt/messages -source "~/.mutt/purgecache.sh $message_cachedir|" +source "$my_configdir/purgecache.sh $message_cachedir|" ## Tell Mutt to check all IMAP folders. This will add all of them to the sidebar ## (if used). Contrary to the 'mailboxes' menu, sorting order cannot be @@ -54,7 +56,7 @@ set mail_check=60 set mail_check_stats=yes ## Mailcap -set mailcap_path=~/.mutt/mailcap +set mailcap_path=$my_configdir/mailcap auto_view text/html alternative_order text/plain text/html @@ -109,22 +111,22 @@ set strict_threads=yes # source "gpg2 -dq ~/.mutt.pwds.gpg |" ## ## Source accounts. Default account is last. -# source "~/.mutt.d/personal" -# folder-hook $folder 'source ~/.mutt.d/personal' -# source "~/.mutt.d/work" -# folder-hook $folder 'source ~/.mutt.d/work' +# source "$my_localdir/personal" +# folder-hook $folder 'source $my_localdir/personal' +# source "$my_localdir/work" +# folder-hook $folder 'source $my_localdir/work' ## ## You can add an optional binding to switch mailboxes: -# macro index,pager 'source ~/.mutt.d/personal!' -# macro index,pager 'source ~/.mutt.d/work!' +# macro index,pager 'source $my_localdir/personal!' +# macro index,pager 'source $my_localdir/work!' -source "~/.mutt.d/accountrc" +source "$my_localdir/accountrc" ################################################################################ ## Aliases. ## Mutt native support. -# set alias_file = "~/.mutt.d/aliases" +# set alias_file = "$my_localdir/aliases" # set sort_alias = alias # set reverse_alias = yes # source $alias_file @@ -146,7 +148,7 @@ bind editor complete-query bind generic,alias,attach,browser,editor,index,compose,pager,pgp,postpone ':' noop ## HTML mail view with graphical Internet browser. -macro attach 'V' "~/.mutt/view-html.sh" +macro attach 'V' "$my_configdir/view-html.sh" ## Remap bounce-message function to "B" bind index B bounce-message @@ -246,19 +248,19 @@ set status_format="-%r-Mutt: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del macro index,pager \CL "$my_index_format_pre"F"$my_index_format_post" ## Set color variables from a theme. -# source "~/.mutt/colors.classic" -source "~/.mutt/colors.zenburn" +# source "$my_configdir/colors.classic" +source "$my_configdir/colors.zenburn" ## Fallback for terminals without 256 colors. This needs to be a shell script so ## that it can check for terminal capabilities. -source "~/.mutt/colors.fallback.sh |" +source "$my_configdir/colors.fallback.sh |" ## Apply theme. -source "~/.mutt/theme" +source "$my_configdir/theme" ################################################################################ ## Sidebar. ## We use a script to test if sidebar is installed. Needs to be loaded _after_ ## the theme. -source "~/.mutt/sidebar.sh|" +source "$my_configdir/sidebar.sh|" diff --git a/.mutt/purgecache.sh b/.config/mutt/purgecache.sh similarity index 100% rename from .mutt/purgecache.sh rename to .config/mutt/purgecache.sh diff --git a/.mutt/sidebar.sh b/.config/mutt/sidebar.sh similarity index 100% rename from .mutt/sidebar.sh rename to .config/mutt/sidebar.sh diff --git a/.mutt/theme b/.config/mutt/theme similarity index 100% rename from .mutt/theme rename to .config/mutt/theme diff --git a/.mutt/view-html.sh b/.config/mutt/view-html.sh similarity index 100% rename from .mutt/view-html.sh rename to .config/mutt/view-html.sh diff --git a/.scripts/homeinit b/.scripts/homeinit index 205a5883..b57f4db8 100755 --- a/.scripts/homeinit +++ b/.scripts/homeinit @@ -13,7 +13,7 @@ echo "==> Abook" ln -snfv "$SOURCEDIR/contacts" "$HOME/.abook" echo "==> Mutt" -[ -d "$SOURCEDIR/mails" ] && ln -snf "$SOURCEDIR/mails" "$HOME/.mutt.d" +[ -d "$SOURCEDIR/mails" ] && ln -snf "$SOURCEDIR/mails" "$XDG_DATA_HOME/mutt" mkdir -pv "$HOME/.cache/mutt/headers" mkdir -pv "$HOME/.cache/mutt/messages"