Crates.io | localbang |
lib.rs | localbang |
version | 0.4.0 |
source | src |
created_at | 2021-09-27 13:49:17.177996 |
updated_at | 2021-09-28 20:03:27.985183 |
description | Cross-platform, cross-browser, cross-search-engine duckduckgo-like bangs |
homepage | https://github.com/jakob-kruse/localbang |
repository | https://github.com/jakob-kruse/localbang |
max_upload_size | |
id | 457014 |
size | 33,153 |
Cross-platform, cross-browser, cross-search-engine duckduckgo-like bangs
Bangs are a way to define where to search inside the query itself. For example you could have a bang with the keyword "!gh" and the url "https://github.com/search?q=%s". Now, whenever your search query contains "!gh" the rest of the query will replace the "%s" in the url.
Example:
"!gh localbang" will result in "https://github.com/search?q=localbang"
yay -S localbang
Download the latest binary release from here and place it in a folder thats in $PATH e.g. /usr/local/bin.
This is easier, but you have to build the binary yourself.
cargo install localbang
git clone https://github.com/jakob-kruse/localbang
cd localbang
cargo build --release
The localbang
binary will be place inside target/release
;
localbang -s <shortcuts_file> -e "https://google.com/search?q=%s" -h "127.0.0.1" -p 8000
This will start a local webserver on port 8000. Every path (e.g. http://localhost:8000/search?q=foo) will be redirected to the search engine (with the query "foo") provided as a second argument (defaults to google search).
You can find a unit file in localbang.service that can be used to start localbang in systemd. Place this in /etc/systemd/user
or ~/.config/systemd/user/
and then systemctl --user enable --now localbang.service
to enable it.
The shortcuts file defined the bangs, which are available. It is a CSV file with two rows: the keyword
and the url
. Examle Shortcuts File
This is the word or letter (could be anything really) that will be used to trigger the search engine specified in the url
column.
The search engine to use for the bang/keyword. This must include a %s
as the placeholder for the query.
Note: Opensearch Integration is planned for the future.
In Chrome you can directly add a custom search engine.
The easiest way is to use the Add custom search engine extension.