summaryrefslogtreecommitdiff
path: root/USAGE
blob: f291db0b6645c738964e4b0633496ca76cb28f3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
USAGE
=====
In all views, arrows, page-up/down, j,k and space can be used to move the focus.
escape cancels prompts. You can hit ":" at any time and type in commands
to the prompt. Any commandline can be mapped by using the "MODE-maps" sections
in the config file. These are the default keymaps:

[global-maps]
$ = flush
: = prompt
; = bufferlist
@ = refresh
I = search tag:inbox AND NOT tag:killed
L = taglist
U = search tag:unread
\ = prompt search 
m = compose
o = prompt search 
q = exit
s = shell
shift tab = bprevious
tab = bnext
x = bclose

[bufferlist-maps]
d = closefocussed
enter = openfocussed

[search-maps]
& = toggletag killed
O = refineprompt
a = toggletag inbox
enter = openthread
l = retagprompt
| = refineprompt

[envelope-maps]
a = attach
enter = reedit
s = prompt subject
t = prompt to
y = send

[taglist-maps]
enter = select

[thread-maps]
C = fold --all
E = unfold --all
H = toggleheader
a = toggletag inbox
enter = select
f = forward
g = groupreply
r = reply


CONFIG
=====
Just like offlineimap or notmuch itself, alot reads a config file in the "INI" syntax:
It consists of some sections whose names are given in square brackets, followed by
key-value pairs that use "=" or ":" as separator, ';' and '#' are comment-prefixes.

The default location for the config file is ~/.alot.rc.
You can find a complete example config in data/example.full.rc.
Here is a key for the interpreted sections:

[general] : global settings: set your editor etc
[account X] : defines the account X: realname, email address, sendmail
[X-maps] : defines keymaps for mode X. possible modes are:
           envelope, search, thread, taglist, bufferlist and global.
           global-maps are valid in all modes.
[tag translate] : defines a map from tagnames to strings that is used when
                  displaying tags. utf-8 symbols welcome.
[X-theme] : define colour palette for colour mode. X is one of
            mono, normal and highcolour, corresponding to colourmodes 1, 16 and 256.

All configs are optional, but if you want to send mails you need to
specify at least one account section.
A sample gmail section:

  [account gmail]
  realname = Patrick Totzke
  address = patricktotzke@gmail.com
  aliases = patricktotzke@googlemail.com
  gpg_key = D7D6C5AA
  sender_type = sendmail
  sendmail_command = msmtp --account=gmail -t

I use this for my uni-account:

  [account uoe]
  realname = Patrick Totzke
  address = ...
  aliases = foobar@myuni.uk;f.bar@myuni.uk;f.b100@students.myuni.uk
  sender_type = sendmail
  sendmail_command = msmtp --account=uoe -t
  sent_mailbox = maildir:///home/pazz/mail/uoe/Sent

Caution: Sending mails is only supported via sendmail for now. If you want
to use a sendmail command different from 'sendmail', specify it as sendmail_command.

send_mailbox specifies the mailbox where you want outgoing mails to be stored
after successfully sending them. You can use mbox, maildir, mh, babyl and mmdf
in the protocol part of the url.



Hooks
=====

Before and after every command execution, alot calls this commands pre/post hook:
Hooks are python callables with arity 4 that live in a module specified by
hooksfile in the global section of your config. Per default this points to '~/.alot.py'
For every command X, the callable 'pre_X' will be called before X and 'post_X' afterwards.

When a hook gets called, it receives instances of
1) alot.ui.UI, the main user interface object that can prompt etc.
2) alot.db.DBManager, the applications database manager
3) alot.account.AccountManager, can be used to look up account info
4) alot.settings.config, a configparser to access the user's config

As an example, consider this pre-hook for the exit command,
that logs a personalized goodby message:

def pre_exit(ui, dbman, accountman, config):
    accounts = accountman.get_accounts()
    if accounts:
        ui.logger.info('goodbye, %s!' % accounts[0].realname)
    else:
        ui.logger.info('goodbye!')