# HG changeset patch # User Ludovic Chabant # Date 1554862144 25200 # Node ID 31079b0600682e139734060b7955c6c53fa3a4a8 # Parent 3b9394a0a58b40cdc1ae7aa691c96a3b40edef6f Update mutt config. diff -r 3b9394a0a58b -r 31079b060068 install.py --- a/install.py Tue Apr 09 18:58:39 2019 -0700 +++ b/install.py Tue Apr 09 19:09:04 2019 -0700 @@ -21,6 +21,18 @@ is_mac = True +def _is_executable(fpath): + return os.path.isfile(fpath) and os.access(fpath, os.X_OK) + + +def which(exename): + for path in os.environ.get("PATH", "").split(os.pathsep): + exepath = os.path.join(path, exename) + if _is_executable(exepath): + return exepath + return None + + def _p(*paths, force_unix=False): res = os.path.join(dotfiles_dir, *paths) if force_unix: @@ -242,8 +254,14 @@ @only_on_nix def install_mutt(): + if which('gpg2'): + gpgbin = 'gpg2' + else: + if not which('gpg'): + print("WARNING: no GPG tools seem to be installed!") + gpgbin = 'gpg' writelines('~/.muttrc', [ - 'source "gpg2 -dq %s |"' % _p('mutt/variables.gpg'), + 'source "%s -dq %s |"' % (gpgbin, _p('mutt/variables.gpg')), 'source "%s"' % _p('mutt/muttrc'), 'source "%s"' % _p('lib/mutt/mutt-colors-solarized/' 'mutt-colors-solarized-dark-256.muttrc') diff -r 3b9394a0a58b -r 31079b060068 mutt/muttrc --- a/mutt/muttrc Tue Apr 09 18:58:39 2019 -0700 +++ b/mutt/muttrc Tue Apr 09 19:09:04 2019 -0700 @@ -5,19 +5,18 @@ # Folders... apparently Mutt doesn't pull all of them automatically. -mailboxes = "imaps://$my_imap/$my_folder_inbox" \ - "imaps://$my_imap/Sent Items" \ - "imaps://$my_imap/Drafts" \ - "imaps://$my_imap/Archive" \ - "imaps://$my_imap/MailingLists" \ - "imaps://$my_imap/Newsletters" \ - "imaps://$my_imap/Trash" - +#mailboxes = "imaps://$my_imap/$my_folder_inbox" \ +# "imaps://$my_imap/Sent Items" \ +# "imaps://$my_imap/Drafts" \ +# "imaps://$my_imap/Archive" \ +# "imaps://$my_imap/MailingLists" \ +# "imaps://$my_imap/Newsletters" \ +# "imaps://$my_imap/Trash" # Basic config #set editor = "vim" set editor = "vim +/^$ ++1 -c 'set tw=76 expandtab nosmartindent spell'" -#set hostname = "$my_hostname" +set hostname = "$my_hostname" set header_cache=~/.mutt/cache/headers set message_cachedir=~/.mutt/cache/bodies set certificate_file=~/.mutt/certificates diff -r 3b9394a0a58b -r 31079b060068 mutt/variables.sample --- a/mutt/variables.sample Tue Apr 09 18:58:39 2019 -0700 +++ b/mutt/variables.sample Tue Apr 09 19:09:04 2019 -0700 @@ -1,14 +1,5 @@ # Account details -set my_imap= -set my_smtp= -set my_user= -set my_pass= -set my_hostname= -set my_realname="" - -# Account folders -set my_url= -set my_folder_inbox= -set my_folder_sent= -set my_folder_drafts= - +set my_user=name@domain.com +set my_pass=yourpassword +set my_hostname=yourmachine +set my_realname="Your Name"