A power tool to choose which search engine to use for every search, quickly.
Searching for 'filter bubble' on Wikipedia |
srch combines the web-searching power of bangs with the speed and ease of dmenu
.
- high configurability
- automatically sort search engines by number of times used (alphabetically on ties)
- python3-xdg
dmenu
is called by default, butrofi
can be configured for use in its place.
- place
srch.py
in your executable path - place srch.json in your XDG compatible config directory (most-likely $HOME/.config/ if you are unsure)
Changes can be made to srch.json to change the dmenu
calls, the enabled search engines, and the web browser to use.
In srch.json, the "search_menu"
and "engine_menu"
keys both describe dmenu
calls. By default their values are "dmenu -p search"
and "dmenu -p engine -i"
, respectfully. These can be modified like normal dmenu
commands or replaced with rofi
commands (in dmenu
mode).
The search engines shown to the user are stored as an object labeled "bangs"
. Key:values in "bangs"
are of the form:
"A readable display name" : "some bang"
where "some bang"
is a valid bang associated with a search engine e.g. !?
, !g
, !w
, etc.
See this page for a list of supported search engines and their associated bangs.
You can also set the first-most displayed search engine by setting the value of the "default"
key to a key existing in the "bangs"
object e.g. "default" : "DuckDuckGo"
or "default" : "Google"
.
The web browser to use can be specified with the "browser"
key. Its value by default is "xdg-open"
. To set firefox as the default browser, for example:
"browser" : "firefox"