bangin – a primitive, portable shell script which enables DuckDuckGo-like bangs


bangin – It be positively bangin’!

bangin is a old skool, portable shell script which enables DuckDuckGo-love bangs. As an instance, an enter of bangin!hn produces an output of

It aspires to be extensible and, with any luck, at last, one thing of a pseudo-identical old.

What’s hostile with DuckDuckGo?

Nothing at all! DuckDuckGo is a absolute best service and bangs are a absolute best idea. They are however miniature attributable to their centralisation.

The major enviornment is that of efficiency. In utter for a person to utilise DuckDuckGo’s bangs, your requests must first develop it to their servers and be redirected. This adds a perceptible delay to your requests sooner than they reach their vacation space.

Secondly, DuckDuckGo has a couple of tips that bangs must adhere to that needn’t exist in a decentralised resolution. As an instance, if you also can hang ever wished to bang your procedure to a risque internet residing, that’s no longer been that you just will in all probability be ready to imagine. Now you will in all probability be ready to!

At last, you can’t override or elevate bangs per your individual need, and you can’t add bangs that “would [not] be worthwhile to better than round 500 folks”. This implies that you just will in all probability be ready to’t put up a bang for that niche internet residing you like, and you likely each so incessantly obtain your self somewhere you did no longer intend to ever be by virtue of a typo. None of these boundaries are technically crucial with a decentralised model.

Why is bangin better?

bangin solves these complications with a easy resolution which is maximally extensible, free in each sense of the be aware, and also can work wherever that can clarify POSIX shell scripts. Given some banglists, which could well per chance be merely textual dispute material recordsdata of newline-separated bangs, the shell script parses your enter and outputs a URL that also can then be forwarded onto a internet browser or other utility.

The intention is that overall bangs will be managed by the community in community lists, and that you just as a person person could well per chance optionally aid your individual private checklist. Instruct of it a miniature bit love adblocking with community-scramble lists of blocked domains.

How win I win began?

There doesn’t yet exist any win of ecosystem round bangin, however I’m hoping this changes. Meanwhile, you will in all probability be ready to trot enter from one thing love dmenu or rofi into bangin and pipe the output to xdg-start or a particular browser. And, because it is a needless easy shell script, any other niche exercise case you also can hang can nearly indubitably be accomodated with upright a miniature bit of scripting. That that you just must obtain an example utilization in my dotfiles.

I aid a couple of lists that you just is also in:

At this time, the absolute best procedure to put in a banglist is to clone the repo and scramble:

mkdir -p ~/.native/fragment/bangin/lists/
ln -s /path/to/repo/example.bangs ~/.native/fragment/bangin/lists/

As for the shell script itself, you will in all probability be ready to both reproduction it onto your machine manually, presumably inserting it somewhere love /usr/native/bin so that it is in your path, or if you’re on Arch you will in all probability be ready to put in it from the AUR.

Technical small print

The shell script is written with POSIX compliance in thoughts, so it ought to scramble nearly wherever. If that’s no longer the case, please suppose a worm!

Banglists are plaintext recordsdata at some stage in which bangs are separated by newlines. On each line is a !bang and a URL with a {{{s}}} token, delimited by a condo. All *.bangs recordsdata in $XDG_DATA_HOME/bangin/lists/ are loaded in reverse alphabetical utter, with precedence being given to the major matching bang. If it exists, $XDG_CONFIG_HOME/bangin/bangin.bangs will be given precedence and loaded first, permitting you to override bangs in community-sourced lists.

Bang aliases in banglists (!a,!b url) must no longer right this moment supported however are planned. Moreover, the prospect of enabling a whole lot of bang output (search !a !b) is one thing to preserve in thoughts.

Bang syntax is right this moment very strict; the bang want to be positioned on the finish of the line, and it is some distance compulsory to hang each a search interval of time and a bang, each non-empty. An enter of a!b!c is interpreted as a search interval of time of a!b and a bang of !c. Failure to stay to this schema will result in a failure exit code.


Unlike most of my projects, which utilise a copyleft license, bangin is MIT licensed to again its fashionable adoption and pseudo-standardisation. We all motivate if the principle of bangs turns into decentralised and normalised.

It could well well per chance be practical for less technically inclined users if anyone wrote a GUI for managing and customising banglists.

It could well well per chance even be practical if anyone could well per chance write some software program that places a skinny internet server round bangin so that it’ll be deployed and feeble on any machine, nearly love a DuckDuckGo substitute. At this level you’d hang the further request all over again, however you’d aloof hang the good thing about bangin‘s customisation, and you’d scramble the code in your individual server that you just knew that you just must well per chance presumably have faith.

I aid an AUR kit, however packages for other distributions and dealing programs would be welcomed.

Read More

Leave A Reply

Your email address will not be published.