Skip to content

Tips, Tricks and other cool Hacks

Dylan Baker edited this page Mar 5, 2018 · 12 revisions

This page collects some neat things you can already do with alot even if they are not super obvious from the documentation.

Saved buffer layouts

You can have a certain set of buffers in a predefined order (a buffer layout) opened for you, every time you start alot. Try to put this in the config file:

initial_command = bufferlist; taglist; search foo; search bar; buffer 0

Folding certain messages when opening a thread buffer

Some people like to fold unread or spam messages when they open a new thread (may for a better overview). Or any other combination you can think of. This is pretty easy with a custom keybinding. You just bind enter to something more complicated than the default select in search buffers. The initial select will open the thread buffer and all further commands will be executed there. For example to unfold only unread messages and the last message in the thread:

[bindings]
  [[search]]
    enter = select; fold *; unfold tag:unread; move last; unfold

Quickly moving through unread messages in a thread

Big threads can have new mails added anywhere in them. To avoid manual scrolling and selection of the unread messages, the following key binding can be used:

[bindings]
  [[thread]]
    ' ' = fold; untag unread; move next unfolded

Whenever the spacebar is pressed, it will collapse the current message, remove the unread tag and put the focus on the next unfolded message in the thread. This can easily be combined with the tip above which only unfolds certain messages (the unread ones) of a thread.

read a PGP inline-encrypted email

Alot will currently show inline encrypted PGP emails as is. See issue #684 for more details. To read such emails, the following keybinding can be used:

[bindings]
    [[thread]]
        d = pipeto 'gpg --use-agent -d | less'

Queuing messages when responding offline

There py-mailqueued (written by one of the alot devs). It's written in python3 and uses NetworkManager with dbus to check network online status.

msmtp has a set of scripts for doing offline queuing included in the base install for managing queued messages. The archwiki has instructions for using them.

Another option for systemd users is the msmtp-queue project, which provides a set of systemd unit files and bash scripts for queue and sending messages.

Viewing hyperlinks in html mail

Alot doesn't handle hyperlinks itself, instead an external program is urlscan, which can scan a thread or message return some context as well as a link. After installing add this to your config:

[bindings]
    [[thread]]
        v = pipeto urlscan 2>/dev/null

Another alternative is the older urlview program, which works much the same way but doesn't provide context.

[bindings]
    [[thread]]
        v = pipeto urlview

Calling arbitrary python code on startup

As many of the other tips show, you can call arbitrary python code by putting it into a function in the hooks file and then call :call hooks.my_function(). This can also be used in the initial_command:

initial_command = search tag:inbox; call hooks.init_code()

As an alot developer I use the version_notification hook from the user contributed hooks page.

Useful mailcap entries

Load gpg signature attachments

application/pgp-keys; gpg --import --interactive --verbose %s; needsterminal;