From 6eaf95464888c19a933634dd745c259b4b459b68 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 28 Dec 2017 20:23:01 +0000 Subject: [PATCH] mutt: use NeoMutt and its config path in XDG_CONFIG_HOME --- Makefile | 6 +++++- aliases | 2 ++ mutt/hooks | 20 ++++++++++---------- mutt/mailcap | 4 ++-- mutt/muttrc | 12 +++++++----- offlineimap/config | 2 +- 6 files changed, 27 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 8892687..3184bb6 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ APATH := $(realpath .) FILES := bin -DOTFILES := goobookrc msmtp* mutt profile tmux.conf weechat Xresources +DOTFILES := goobookrc msmtp* profile tmux.conf weechat Xresources CONFIGFILES := aliases compton.conf git mpv offlineimap ranger retroarch xbindkeys xkb .PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES) @@ -16,6 +16,10 @@ vim: git clone https://github.com/gmarik/vundle ~/.local/share/vim/vundle .PHONY: vim +mutt: + ln -sfT $(APATH)/mutt ~/.config/mutt +.PHONY: mutt + gdb: ln -sfT $(APATH)/gdbinit ~/.gdbinit ln -sfT $(APATH)/cgdb ~/.cgdb diff --git a/aliases b/aliases index a1641cb..5b30607 100644 --- a/aliases +++ b/aliases @@ -18,6 +18,8 @@ alias svi='sudo -e' #alias vp='vim PKGBUILD' # I have a script for that in ~/bin alias vs='vim SPLITBUILD' +alias mutt='neomutt' + # colours, I want more colours [[ -x /usr/bin/colordiff ]] && alias diff='colordiff' diff --git a/mutt/hooks b/mutt/hooks index b002615..4a8685d 100644 --- a/mutt/hooks +++ b/mutt/hooks @@ -1,13 +1,13 @@ # vim: ft=muttrc -reply-hook . source ~/.mutt/accounts/gmail -reply-hook "%L chakra" source ~/.mutt/accounts/chakra -reply-hook "%L unimaas" source ~/.mutt/accounts/unimaas -reply-hook "%L cadscan" source ~/.mutt/accounts/cadscan +reply-hook . source $my_config_dir/accounts/gmail +reply-hook "%L chakra" source $my_config_dir/accounts/chakra +reply-hook "%L unimaas" source $my_config_dir/accounts/unimaas +reply-hook "%L cadscan" source $my_config_dir/accounts/cadscan -folder-hook . source ~/.mutt/accounts/gmail -folder-hook chakra source ~/.mutt/accounts/chakra -folder-hook unimaas source ~/.mutt/accounts/unimaas -folder-hook cadscan source ~/.mutt/accounts/cadscan +folder-hook . source $my_config_dir/accounts/gmail +folder-hook chakra source $my_config_dir/accounts/chakra +folder-hook unimaas source $my_config_dir/accounts/unimaas +folder-hook cadscan source $my_config_dir/accounts/cadscan folder-hook .* "exec collapse-all" @@ -26,6 +26,6 @@ set my_pipe_decode=$pipe_decode folder-hook .* bind index,pager m mail folder-hook .* bind pager next-line folder-hook .* set pipe_decode=$my_pipe_decode -folder-hook youtube 'macro index,pager m "~/.mutt/mutt_mpv"' -folder-hook youtube 'macro pager "~/.mutt/mutt_mpv"' +folder-hook youtube 'macro index,pager m "$my_config_dir/mutt_mpv"' +folder-hook youtube 'macro pager "$my_config_dir/mutt_mpv"' folder-hook youtube 'set my_pipe_decode=$pipe_decode;set pipe_decode=yes' diff --git a/mutt/mailcap b/mutt/mailcap index b5c4dee..71b7502 100644 --- a/mutt/mailcap +++ b/mutt/mailcap @@ -1,4 +1,4 @@ -text/html; ~/.mutt/mutt_bgrun qutebrowser %s; test=test -n "$DISPLAY"; nametemplate=%s.html +text/html; $XDG_CONFIG_HOME/mutt_bgrun qutebrowser %s; test=test -n "$DISPLAY"; nametemplate=%s.html text/html; w3m -I %{charset} -dump %s -T text/html -cols "$COLUMNS" -o display_link_number=1; copiousoutput; nametemplate=%s.html -application/*; ~/.mutt/mutt_bgrun rifle -f F %s; +application/*; $XDG_CONFIG_HOME/mutt_bgrun rifle -f F %s; image/*; rifle -f F %s; diff --git a/mutt/muttrc b/mutt/muttrc index 44cec6a..e7b41ba 100644 --- a/mutt/muttrc +++ b/mutt/muttrc @@ -1,3 +1,5 @@ +set my_config_dir = $XDG_CONFIG_HOME/mutt + # general settings alternates -group me samir.benmendil@gmail.com ram-z@hotmail.com @rmz.io alternates -group me -group chakra ram-z@chakra chakra@rmz.io @@ -69,7 +71,7 @@ unhdr_order * hdr_order from: to: cc: date: subject: x-clacks-overhead: # deal with crap -set mailcap_path = ~/.mutt/mailcap +set mailcap_path = $my_config_dir/mailcap auto_view text/html # view html automatically alternative_order text/plain text/enriched text/html # save html for last @@ -80,7 +82,7 @@ unset record # do not move sent msgs to a folder, gmail d unset move # do not move read msgs, gmail does that set postponed = "+gmail/drafts" # drafts folder set header_cache = "~/.cache/mutt" # cache headers for speedss -source ~/.mutt/mailboxes # source mailboxes generetated by offlineimap +source $my_config_dir/mailboxes # source mailboxes generetated by offlineimap # SMTP: msmtp set sendmail = /usr/bin/msmtp # use msmtp @@ -101,6 +103,6 @@ group -group nosign -rx jira@.*atlassian.net send-hook . "set crypt_autosign = yes" send-hook "%t nosign" "set crypt_autosign = no" -source ~/.mutt/hooks -source ~/.mutt/bindings -source ~/.mutt/colors/badfox # color theme +source $my_config_dir/hooks +source $my_config_dir/bindings +source $my_config_dir/colors/badfox # color theme diff --git a/offlineimap/config b/offlineimap/config index e79d65e..ac15582 100644 --- a/offlineimap/config +++ b/offlineimap/config @@ -10,7 +10,7 @@ fsync = false [mbnames] enabled = yes -filename = ~/.mutt/mailboxes +filename = $my_config_dir/mailboxes header = "mailboxes " peritem = "+%(accountname)s/%(foldername)s" sep = " " -- 2.48.1