Install alot from cloned repo on Mac OS X

Just a short note on how to install alot from a cloned repository. This might be incomplete since its from memory and I am writing this down since I had to to a reinstall and I had to figure it out again.

You can install alot from homebrew using brew install alot, but I needed to modify the code so the tag autocompletion search the whole tag name for the substring (e.g. typing “cur” would not autocomplete to “@/Current” without changing a default parameter in the code).

So I install notmuch via homebrew:

$ brew install notmuch

then clone pazz/alot:

$ cd parent-dir-to-where-you-want-the-alot-repo
$ git clone https://github.com/pazz/alot.git

I am using pyenv together with pyenv-virtualenv to manage my python versions. These are installed via homebrew as well:

$ brew install pyenv pyenv-virtualenv

If you are just installing pyenv and pyenv-virtualenv now, you’ll need make a change to your .profile and install at least one version of python2 before installing alot from the cloned repository.

Add the following to your .profile and restart your shell (or source ~/.profile it):

# pyenv
# bonus export below that is not needed for alot, but needed
# if you want to use python with e.g. nvim
export PYTHON_CONFIGURE_OPTS="--enable-framework"
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi

# pyenv-virtualenv
# another bonus export, not strictly needed, but gets rid of a
# prompt when switching virtual environments
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi

Now install e.g. python 2.7.12 via pyenv:

$ pyenv install 2.7.12

Then create a virtualenv for alot an activate it:

$ pyenv virtualenv alot
$ pyenv activate alot

Finally, before you can install, you need to add the python packages installed by homebrew to your virtual environment:

echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> $PYENV_VIRTUAL_ENV/lib/python2.7/site-packages/homebrew.pth

This adds the file homebrew.pth to your virtualenv site-packages directory which contains a reference to the site-packages directory used by homebrew. Now you can finally install alot from your cloned repository:

$ cd path-to-alot-repo
$ pip install -e ./

pip should see that the notmuch library is avaliable and will not install its own (which I couldn’t get to access the notmuch bindings installed by homebrew). You should now be able to run alot if the correct virtualenv is activated.

# activate the alot virtualenv if you havnt
$ pyenv activate alot

# run alot
$ alot

If you get an error about python not being able to find the shared notmuch library, try pip uninstall notmuch in case pip installed it anyway. Also make sure that you have installed notmuch via brew and that there is a directory named notmuch in /usr/local/lib/python2.7/site-packages (where homebrew installs its python packages).

Advertisement

Remove Duplicate Messages (Alternate) for Thunderbird

I just removed almost 1000 duplicates from my e-mail using Remove Duplicate Messages (Alternate), an extension for Thunderbird. To remove duplicates from all folders, just select the root of the tree (i.e. the name of the accound).

Worked great. By selecting the email message, it gets selected in Thunderbird so you also can read the actual content.

New email setup

I think I am going to be quite happy with my new email setup. It has taken a while, actually I’m not quite done yet, but I think it is going to be awesome.

I started writing a lengthy post about this, but it grew to long. So, here’s the tl;dw (too long, did not write) version:

  • I had too much email in my inbox that came from different areas of responsibility.
  • After moving my email from my gmail to my work imap (Exchange), I discovered Exchange does not support keywords (custom flags).
  • I forward my work email to a third party IMAP that supports keywords (Dovecot), but still use my work SMTP.