diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/aerc.conf | 9 | ||||
-rw-r--r-- | config/openers.go | 13 |
2 files changed, 7 insertions, 15 deletions
diff --git a/config/aerc.conf b/config/aerc.conf index 18c6decc..06cfb2d1 100644 --- a/config/aerc.conf +++ b/config/aerc.conf @@ -548,9 +548,10 @@ message/rfc822=colorize # actions on a per-MIME-type basis. The :open-link URL scheme is used to # determine the MIME type as follows: x-scheme-handler/<scheme>. # -# {} 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. +# {} is expanded as the temporary filename or URL to be opened with proper +# shell quoting. If it is not encountered in the command, the filename/URL will +# be appended to the end of the command. The command will then be executed with +# `sh -c`. # # Like [filters], openers support basic shell globbing. The first opener which # matches the part's MIME type (or URL scheme handler MIME type) will be used, @@ -558,7 +559,7 @@ message/rfc822=colorize # # Examples: # x-scheme-handler/irc=hexchat -# x-scheme-handler/http*=firefox +# x-scheme-handler/http*=printf '%s' {} | wl-copy # text/html=surf -dfgms # text/plain=gvim {} +125 # message/rfc822=thunderbird diff --git a/config/openers.go b/config/openers.go index e246ea64..31d99e9c 100644 --- a/config/openers.go +++ b/config/openers.go @@ -1,17 +1,15 @@ package config import ( - "fmt" "strings" "git.sr.ht/~rjarry/aerc/log" "github.com/go-ini/ini" - "github.com/google/shlex" ) type Opener struct { Mime string - Args []string + Args string } var Openers []Opener @@ -24,14 +22,7 @@ func parseOpeners(file *ini.File) error { for _, key := range openers.Keys() { mime := strings.ToLower(key.Name()) - if args, err := shlex.Split(key.Value()); err != nil { - return err - } else { - if len(args) == 0 { - return fmt.Errorf("opener command empty for %s", mime) - } - Openers = append(Openers, Opener{Mime: mime, Args: args}) - } + Openers = append(Openers, Opener{Mime: mime, Args: key.Value()}) } out: |