So called «smart bookmarks» (i.e. the abbreviated aliases used to make queries easier) are certainly useful. Indeed, I've been using them for years and have come to depend on them, but all of the implementations I've used were missing one useful thing or another, and the data can be difficult to import/export between browsers.
Even if it did work as I wish in my preferred browser, separation can be useful, and this tool provides that independence along with the following features:
The url-query script accepts a key and query-text substitution part(s).
url-query key q...
e.g. Search Wikipedia for the phrase 'robert anton wilson':
url-query w 'robert anton wilson'
multi-part e.g. Language translation (from, to, text):
url-query tr en fr 'keep it simple'
The current text selection can be used directly (i.e. no need to copy/paste). Option -s
, with one or more keys as arguments, uses the text selection as the query-text (i.e. singular substitution part) for each URL.
url-query -s key...
Option -q
toggles quoting. If the text selection contains spaces, it can be automatically quoted by setting the default value in the script, or by using option -q
(which simply toggles the default).
url-query -q key...
Option -p
prints each URL to standard output instead of opening it.
url-query -p key q...
{k}
→ key, {n}
→ name{k} - {n}
→ ia - Internet Archive
Option -n
can be used to add a new record (which is useful because it tests to avoid duplicates, and prompts for a new key if necessary).
url-query -n key name URL-or-key(s)
url-query -n ted 'TED talks' 'https://www.ted.com/search?q=%s'
url-query
, the other calls url-query -s
.