aerc/lib
Robin Jarry 45bff88515 open: allow overriding default program
Instead of xdg-open (or open on MacOS), allow forcing a program to open
a message part. The program is determined in that order of priority:

1) If :open has arguments, they will be used as command to open the
   attachment. If the arguments contain the {} placeholder, the
   temporary file will be substituted, otherwise the file path is added
   at the end of the arguments.

2) If a command is specified in the [openers] section of aerc.conf for
   the part MIME type, then it is used with the same rules of {}
   substitution.

3) Finally, fallback to xdg-open/open with the file path as argument.

Update the docs and default config accordingly with examples.

Fixes: https://todo.sr.ht/~rjarry/aerc/64
Co-authored-by: Jason Stewart <support@eggplantsd.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
2022-10-01 15:47:25 +02:00
..
auth lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
calendar lint: ensure errors are at least logged (errcheck) 2022-08-04 21:57:57 +02:00
crypto pgp: enable quoted replies of encrypted messages 2022-08-31 10:10:03 +02:00
format msgstore: post MessageInfo on erroneous fetch 2022-09-20 00:03:36 +02:00
marker mark: allow multiple visual selections 2022-08-22 09:30:37 +02:00
parse open-link: make URL parsing more lenient 2022-09-13 23:58:53 +02:00
sort go.mod: change base git url 2021-11-05 10:21:45 +01:00
statusline statusline-format: add %p placeholder for current path 2022-09-19 21:25:10 +02:00
templates lint: apply new formatting rules 2022-08-01 10:44:52 +02:00
ui ui: avoid panic when terminal window is shrunk 2022-09-26 17:32:00 +02:00
uidstore Create UIDStore package 2019-07-12 11:09:47 -04:00
attachment.go compose: refactor attachment handling 2022-07-02 17:52:49 +02:00
dirstore.go Move msgstore map to dirstore 2019-07-26 14:15:27 -04:00
history.go Add command history and cycling 2019-07-26 14:29:34 -04:00
keepalive_dummy.go format: reformat code with go 1.17 2021-12-11 23:24:08 +01:00
keepalive_linux.go format: reformat code with go 1.17 2021-12-11 23:24:08 +01:00
messageview.go charset: handle unknown charsets more user-friendly 2022-09-25 11:54:23 +02:00
msgstore.go msgstore: revert 9fdc7acf5b "post messageInfo on erroneous fetch" 2022-09-25 11:54:26 +02:00
oauthbearer.go lint: work nicely with wrapped errors (errorlint) 2022-08-04 21:58:04 +02:00
open.go open: allow overriding default program 2022-10-01 15:47:25 +02:00
socket.go socket: use existing socket if it is connected 2022-09-14 00:03:01 +02:00
structure_helpers.go lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
structure_helpers_test.go lint: apply new formatting rules 2022-08-01 10:44:52 +02:00
threadbuilder.go lint: ensure errors are at least logged (errcheck) 2022-08-04 21:57:57 +02:00