GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - travis-g/bang: Browser launching inspired by DuckDuckGo's !bangs

BranchesTags
Open more actions menu

Latest commit

 

History

32 Commits
32 Commits

Folders and files

NameName
Last commit message
Last commit date
cmd/bang
cmd/bang
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
bang.go
bang.go
 
 
bang.pb.go
bang.pb.go
 
 
bang.proto
bang.proto
 
 
bangs.json
bangs.json
 
 

Repository files navigation

bang

GoDoc

Browser launcher, heavily inspired by DuckDuckGo's !bangs.

Search for cat pictures on Google Images:

bang gi cat pictures
# opens a browser to 'cat pictures' on Google Images

Queries can also be piped through stdin if a hyphen is passed in as the argument, and the -url flag can be used to print the bang's URL to stdout rather than launching a browser.

$ echo "cat pictures" | bang -url gi -
https://www.google.com/search?tbm=isch&q=cat+pictures
$ echo "reddit cat pictures" | bang -url -
https://www.reddit.com/search?q=cat+pictures

The system's URL opener will be used by default, but if set, the BROWSER environment variable will be executed with the chosen bang's URL passed as the final argument.

Installation

To get everything and install the CLI into your GOPATH:

go get -u github.com/travis-g/bang/...

The CLI is available from within cmd/bang.

Config

The CLI looks for a config file named bangs.(json|yml|yaml|toml|hcl) in the following locations, in order:

~/.config/bang/
~/.config/
./ (current directory)

Each key of the config file should be the unique name of a Bang, with the following properties:

  • description (string: <req>) is a friendly description for the Bang.
  • escape_method (int: 0) defines how the query is escaped prior to it being substituted within the Bang's format:
    • 0 - Escapes with url.QueryEscape: cat pictures ⇒ cat+pictures. This is the default method.
    • 1 - Pass-through without escaping: cat pictures ⇒ cat pictures
    • 2 - Escapes with url.PathEscape: cat pictures ⇒ cat%20pictures
  • format (string: <req>) defines the template used to create the Bang's resulting query string. Use {{{s}}} to denote where the query should be substituted.

Example YAML config file entry for GoDoc:

godoc:
  # try it: bang godoc github.com/travis-g/bang
  description: GoDoc
  escape_method: 1
  format: "https://godoc.org/{{{s}}}"

See the bang.proto file for the Bang object format.

About

Browser launching inspired by DuckDuckGo's !bangs

Topics

cli-toolworkflow

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.