Closed smhmd closed 4 years ago
Based on the title, are you looking to have a way to pass through the query exactly, without any escaping? escape_method: 1
for PASS_THROUGH
may be what you're looking for. The escape methods are going into the help text/usage info soon.
The default sourcegraph
bang uses the pass-through option:
% jq .sourcegraph bangs.json
{
"description": "Sourcegraph",
"escape_method": 1,
"format": "https://sourcegraph.com/{{{s}}}"
}
% ./bang -url sourcegraph github.com/travis-g/bang
https://sourcegraph.com/github.com/travis-g/bang
To clarify about your xclip suggestion, are you looking for a way to do multi-parameter/multi-query bangs? Or conditional logic?
are you looking for a way to do multi-parameter/multi-query bangs? Or conditional logic?
I was thinking of opening an issue about multi-parameter.
The idea is to abstract clipboard in scripts/automation in contexts where ctrl+v
isn't present like dmenu
.
In the picture, I have WebAssembly
selected, hit my keybinding for dmenu, and enter search terms @@ additional search terms
.
This opens https://www.google.com/search?q=WebAssembly+with+rust
.
similarly, multi-parameters can be abstracted by some sort of delimiter.
wa:
description: Send Whatsapp Message
format: https://api.whatsapp.com/send?phone={{{s1}}}&text={{{s2}}}
Opens https://api.whatsapp.com/send?phone=15551234567&text=okay
.
A suggestion: One thing I do in my dmenu script, is that I subtitute
@@
withxclip -o
(secondary selection) if it holds something. You could consider that. I can think of a configurable@@
for secondary selection and@!
for primary selection. Maybe you can think of some other interface.