amfora icon indicating copy to clipboard operation
amfora copied to clipboard

Allow custom URL placement for external handlers

Open t-900-a opened this issue 4 years ago • 3 comments

Relevant code: https://github.com/makeworld-the-better-one/amfora/blob/4ecdede58006e77dd23a27b40752103afa6fb989/display/handlers.go#L81

It would be better if the custom commands that are specified in the config could have parameters within them.

Right now the url is concatenated to the end of the specified command.

I.e. instead of appending to the end, all instances of {url_param} are replaced within the url

t-900-a avatar Mar 21 '21 05:03 t-900-a

Could you give me an example use case where having the URL at the end of the command doesn't work?

makew0rld avatar Mar 22 '21 17:03 makew0rld

Could you give me an example use case where having the URL at the end of the command doesn't work?

Opening up a new terminal window to display something in a specific application gnome-terminal -- "myprogram --uri %s"

I don't see a way to display a cli program in a new terminal without having the quotes

I'd definitely be open to any alternatives, if there aren't any would you be willing to accept a pull request with this change?

t-900-a avatar Mar 22 '21 20:03 t-900-a

There might be a way around this, but if you're offering a pull request than I'm happy to merge this and add it. Just make sure you document it in the default-config.toml file. I would suggest something like {{url}} being the replaced text. Thanks!

makew0rld avatar Mar 23 '21 01:03 makew0rld