aerc/commands/msgview
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
..
close.go tabs: rename SelectedTab to SelectedTabContent 2022-07-23 22:00:21 +02:00
msgview.go lint: apply new formatting rules 2022-08-01 10:44:52 +02:00
next-part.go tabs: rename SelectedTab to SelectedTabContent 2022-07-23 22:00:21 +02:00
next.go tabs: rename SelectedTab to SelectedTabContent 2022-07-23 22:00:21 +02:00
open.go open: allow overriding default program 2022-10-01 15:47:25 +02:00
save.go lint: apply new formatting rules 2022-08-01 10:44:52 +02:00
toggle-headers.go tabs: rename SelectedTab to SelectedTabContent 2022-07-23 22:00:21 +02:00
toggle-key-passthrough.go tabs: rename SelectedTab to SelectedTabContent 2022-07-23 22:00:21 +02:00