~rjarry/aerc-devel

aerc: commands: add configuration for open-link v2 NEEDS REVISION

Kirill Chibisov: 1
 commands: add configuration for open-link

 4 files changed, 8 insertions(+), 5 deletions(-)
#953990 alpine-edge.yml success
#953991 openbsd.yml success
> +a per-MIME-type basis and for *:open-link* with the open-link key. They are
Next
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rjarry/aerc-devel/patches/39570/mbox | git am -3
Learn more about email & git

[PATCH aerc v2] commands: add configuration for open-link Export this patch

This should provide a way to configure link opener for users not having
xdg-open or similarly named script in the first place.

Signed-off-by: Kirill Chibisov <contact@kchibisov.com>
---
 CHANGELOG.md          | 1 +
 config/aerc.conf      | 3 ++-
 doc/aerc-config.5.scd | 7 ++++---
 lib/open.go           | 2 +-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index cc22944..08023ae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

- Configuration for `:open-link` via `[openers]` section in `aerc.conf`.
- New column-based message list format with `index-columns`.
- Add a `msglist_answered` style for answered messages.
- Compose `Format=Flowed` messages with `format-flowed=true` in `aerc.conf`.
diff --git a/config/aerc.conf b/config/aerc.conf
index cb6e864..9a8c0d5 100644
--- a/config/aerc.conf
+++ b/config/aerc.conf
@@ -488,13 +488,14 @@ message/rfc822=colorize
[openers]
#
# Openers allow you to specify the command to use for the :open action on a
# per-MIME-type basis.
# per-MIME-type basis and for the :open-link command by using `open-link` key.
#
# {} is expanded as the temporary filename to be opened. If it is not
# encountered in the command, the temporary filename will be appened to the end
# of the command.
#
# Examples:
# open-link=firefox
# text/html=surf -dfgms
# text/plain=gvim {} +125
# message/rfc822=thunderbird
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index 4d64a6f..b69f404 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -803,9 +803,9 @@ customizations of the built-in filters.

# OPENERS

Openers allow you to specify the command to use for the *:open* action on a
per-MIME-type basis. They are configured in the *[openers]* section of
_aerc.conf_.
Openers allow you to specify the command to use for the *:open* action on
a per-MIME-type basis and for *:open-link* with the open-link key. They are
configured in the *[openers]* section of _aerc.conf_.

_{}_ is expanded as the temporary filename to be opened. If it is not
encountered in the command, the temporary filename will be appened to the end
@@ -815,6 +815,7 @@ Example:

```
[openers]
open-link=firefox
text/html=surf -dfgms
text/plain=gvim {} +125
message/rfc822=thunderbird
diff --git a/lib/open.go b/lib/open.go
index 8477b8f..c25472e 100644
--- a/lib/open.go
+++ b/lib/open.go
@@ -11,7 +11,7 @@ import (
)

func XDGOpen(uri string) error {
	return XDGOpenMime(uri, "", nil)
	return XDGOpenMime(uri, "open-link", nil)
}

func XDGOpenMime(
-- 
2.39.2
aerc/patches: SUCCESS in 6m22s

[commands: add configuration for open-link][0] v2 from [Kirill Chibisov][1]

[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/39570
[1]: mailto:contact@kchibisov.com

✓ #953991 SUCCESS aerc/patches/openbsd.yml     https://builds.sr.ht/~rjarry/job/953991
✓ #953990 SUCCESS aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/953990
Reviewed-by: Moritz Poldrack <moritz@poldrack.dev
Hi Kirill,

thanks for your patch. I have a few remarks. Please see below:

Kirill Chibisov, Mar 08, 2023 at 21:22: