| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Add the [ui].dialog-{position,width,height} options in aerc.conf to set
the position, width and height of popover dialogs such as the one from
:menu, :envelope or :attach -m relative to the main window.
Changelog-added: Add `[ui].dialog-{position,width,height}` to set
the position, width and height of popover dialogs.
Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
This has nothing to do at the root of the source tree.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Bence Ferdinandy <bence@ferdinandy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Define two new constructor functions for the popup dialog.
DefaultDialog() creates a dialog that spans half of the screen, whereas
the LargeDialog() covers three-quarter of the screen.
If a dialog widget has more specific size requirements, custom window
position and window height functions can be used with NewDialog().
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Register all commands with the same function and store them in the same
map.
Use bit flags to determine in which contexts each command should be
available.
Remove duplicate commands now that the same command can be exposed in
multiple contexts.
Refactor API to allow executing commands from other commands without
import cycles.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Folders that contain spaces are surrounded by quotes. They can never end
with '/'. Hence they are never returned in the completion results.
Update CompletePath with an additional onlyDirs argument to take care of
this before quotes are inserted.
Fixes: abe228b14d97 ("commands: use completion from go-opt")
Fixes: https://todo.sr.ht/~rjarry/aerc/204
Reported-by: Bence Ferdinandy <bence@ferdinandy.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Implement command completion with complete struct field tags from the
get-opt library introduced earlier.
Changelog-changed: Improved command completion.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
Tested-by: Inwit <inwit@sindominio.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the argument parsing framework introduced earlier to unify the
parsing of (almost) all command options. Remove custom parsing code and
to avoid extraneous types, add fields with `opt` tags on command structs
that have options and arguments. Commands that take no argument do not
need anything.
Since the command objects now carry data, create a new temporary
instance of them before passing them to opt.ArgsToStruct when executing
a command.
A few of the commands use specific semantics for parsing (:choose), or
are delegating argument parsing to another function (:sort, :search,
:filter). For these commands, simply add a dummy "-" passthrough
argument. Since all commands still have the argument list (after split)
nothing needs to be changed in this area.
There should be no functional change besides the Usage strings and
reported errors which are now generated automatically.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
Tested-by: Inwit <inwit@sindominio.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The single Aerc object is passed around in almost all command functions.
This hinders readability.
Store the single Aerc instance as a global variable. Export public
functions from the app package to access methods of that object. Remove
all explicit references to *app.Aerc and replace them with calls to
these functions. For references to private/unexported fields and
functions from within the app package, directly access the global aerc
object.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
|
|
|
|
|
|
|
|
|
| |
This is the central point of all aerc. Having it named widgets is
confusing. Rename it to app. It will make a cleaner transition when
making the app.Aerc object available globally in the next commit.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
|
|
|
|
|
|
|
|
|
|
|
| |
github.com/mitchellh/go-homedir has not received any update since 2019.
The last release of github.com/kyoh86/xdg was in 2020 and it has been
marked as deprecated by its author.
Replace these with internal functions.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, aerc reads a list of files to be attached to a message from
the file-picker-cmd's standard output. However, this doesn't play nice
with ranger which seems to draw itself by writing there, causing it to
be invisible in the embedded terminal.
In fact, instead of using a pipe, aerc redirects the output of the
command to a temporary file and then reads the list of files from there.
Take advantage of this approach and allow user to directly reference
this temporary file in the file-picker-cmd via the %f placeholder, which
gets expanded to the temporary file's location. If the %f placeholder
isn't present, keep the old behaviour.
So for example, now it is possible to do:
file-picker-cmd=ranger --choosefiles=%f
in aerc.conf.
Signed-off-by: Karel Balej <balejk@matfyz.cz>
Acked-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the -r option to :attach so that the attachments can be piped in
from a command. Example:
:attach -r image.jpg read-jpeg-from-clipboard.sh
It takes two parameters: the attachment name (to be used in the email
and to get the MIME type from) and the command to execute and read the
output.
Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz>
Acked-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Koni Marti <koni.marti@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Focus terminal for file picker to ensure that terminal is correctly
redrawn when using it. After commit 382aea4a ("terminal: avoid high cpu
usage when not focused"), the file picker terminal in the attach command
(when called with the -m flag) would not work as expected.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the time it is not wanted to attach hidden files, but by default
globbing does include hidden files.
Add a small check that removes hidden files from the results if they are
not explicitly globbed for or inside a hidden directory.
Implements: https://todo.sr.ht/~rjarry/aerc/83
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is only one instance of AercConfig which is associated to the Aerc
widget. Everywhere we need to access configuration options, we need
somehow to get a reference either to the Aerc widget or to a pointer to
the AercConfig instance. This makes the code cluttered.
Remove the AercConfig structure and every place where it is referenced.
Instead, declare global variables for every configuration section and
access them directly from the `config` module.
Since bindings and ui sections can be "contextual" (i.e. per account,
per folder or per subject), leave most local references intact.
Replacing them with config.{Ui,Binds}.For{Account,Folder,Subject} would
make this patch even more unreadable. This is something that may be
addressed in the future.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
| |
Use the same name than the builtin "log" package. That way, we do not
risk logging in the wrong place.
Suggested-by: Tim Culverhouse <tim@timculverhouse.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main goal is to ensure that by default, the log file (if configured)
does not grow out of proportions. Most of the logging messages in aerc
are actually for debugging and/or trace purposes.
Define clear rules for logging levels. Enforce these rules everywhere.
After this patch, here is what the log file looks like after starting up
with a single account:
INFO 2022/11/24 20:26:16.147164 aerc.go:176: Starting up version 0.13.0-100-g683981479c60 (go1.18.7 amd64 linux)
INFO 2022/11/24 20:26:17.546448 account.go:254: [work] connected.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
| |
Draw a framed box with a title containing an interactive-drawable
widget.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Open a user-defined file picker with the -m flag for the attach command
to select attachments.
Specify your file picker of choice with the 'file-picker-cmd' in the
[composer] section of aerc.conf, e.g. "file-picker-cmd=fzf -m".
A '%s' placeholder can be used in the 'file-picker-cmd' which is then
substituted for the argument <arg> provided to :attach -m <arg>.
For example, when you set 'file-picker-cmd=find %s -type f | fzf -m',
you can easily change the directory to start the search with ':attach -m
<path-to-search>'.
Tested with fzf, fzy and peco.
Implements: https://todo.sr.ht/~rjarry/aerc/108
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
| |
Enable path globbing using Go's standard library globbing capabilities,
which allows for attaching multiple files at once.
Suggested-by: Anderson John Njahi <johnjahi55@gmail.com>
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
This function returns an ui.Drawable. Use a more explicit name. This
prepares for adding a new SelectedTab function which will return
an ui.Tab.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Koni Marti <koni.marti@gmail.com>
|
|
|
|
|
|
|
| |
I'm not sure what are the implications but it seems required.
Link: https://github.com/golang/go/issues/20883
Signed-off-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
| |
The individual callers should not be responsible for padding
|
|
|
|
|
|
| |
Introduce the ability to configure stylesets, allowing customization of
aerc's look (color scheme, font weight, etc). Default styleset is
installed to /path/to/aerc/stylesets/default.
|
|
|
|
| |
This reverts commit 1ff687ca2b0821c2cacc1fa725abb3302d2af9da.
|
|
|
|
|
|
| |
Introduce the ability to configure stylesets, allowing customization of
aerc's look (color scheme, font weight, etc). Default styleset is
installed to /path/to/aerc/stylesets/default.
|
|
|
|
| |
This reverts commit 0f78f06610c0e8887aba2ae50e99b86477a384b3.
|
|
|
|
| |
This reverts commit f06d683688e3d2139b14f67b7e349089e7200bf4.
|
|
|
|
| |
We always set 10 seconds anyhow, might as well do that without repeating ourselfs.
|
|
|
|
|
|
|
|
|
|
| |
The following functionalities are added to configure aerc ui styles.
- Read stylesets from file with very basic fnmatch wildcard matching
- Add default styleset
- Support different stylesets as part of UiConfig allowing contextual
styles.
- Move widgets/ui elements to use the stylesets.
- Add configuration manual for the styleset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch ensures the following commands join their arguments with
spaces to make it easier to interact with:
- cf
- mkdir
- cd
- attach
- detach
- ct
- copy
- move
- save
|
|
|
|
| |
Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
|
|
|
|
|
| |
Tab-completions now cycle through filesystem paths when using :attach or
:cd commands.
|
|
Allow users to add attachments to emails in the Compose view. Syntax is
:attach <path>, where path is a valid file. Attachments will show up in
the pre-send review screen.
|