diff options
author | Robin Jarry <robin@jarry.cc> | 2023-12-05 00:15:45 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-01-20 21:56:52 +0100 |
commit | 5b76547c3b3566ef878d0937b5cb1e91376d2206 (patch) | |
tree | 08828400ec5005ff19bbc2e1d9502ebb986bf33a /lib/ui | |
parent | 159fb38daf5336758abc425447cf2c2ed51de59a (diff) | |
download | aerc-5b76547c3b3566ef878d0937b5cb1e91376d2206.tar.gz |
commands: add menu
Add a new :menu command that can be used to spawn a shell command in an
interactive dialog and execute aerc commands for each of the lines
printed on its standard output like xargs(1) would do in a shell.
The shell command can be configured in aerc.conf under
[general].default-menu-cmd and overridden via the :menu -c <cmd> option.
There are two flags to provide input text to the shell command which can
be useful in combination with other aerc commands:
-a: All account names, one per line:
'<account>' LF
-d: All current account directory names, one per line:
'<directory>' LF
-ad: All directories of all accounts, one per line:
'<account>' '<directory>' LF
Here are some examples:
:menu -adc fzf :cf -a
:menu -c 'fzf --multi' :attach
:menu -dc 'fzf --multi' :cp
And also for key bindings:
<C-p> = :menu -adc fzf :cf -a<Enter>
Changelog-added: New `:menu` command to invoke other aerc commands
based on a shell command output.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
Diffstat (limited to 'lib/ui')
-rw-r--r-- | lib/ui/box.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ui/box.go b/lib/ui/box.go index 96b95d59..e13b70f3 100644 --- a/lib/ui/box.go +++ b/lib/ui/box.go @@ -45,6 +45,7 @@ func (b *Box) Draw(ctx *Context) { ctx.Printf(0, h-1, style, "%c%s%c", box[5], strings.Repeat(string(box[6]), w-2), box[7]) if b.title != "" && w > 4 { + style = b.uiConfig.GetStyle(config.STYLE_TITLE) title := runewidth.Truncate(b.title, w-4, "…") ctx.Printf(2, 0, style, "%s", title) } |