Skip to content
odnar-dev edited this page Sep 21, 2021 · 12 revisions

nbrowser uses a simple shell-based config file, which is located in $HOME/.config/nbrowser/config.

if the file does not exist, just create it

Variables

NBROWSER_DEFAULT_SEARCH   Default search engine to use. (default: duckduckgo)
NBROWSER_PDF_VIEWER       Pdf Viewer to use when opening pdf files. (default: zathura)
NBROWSER_HTML_EDITOR      TEXT Editor to use when opening html files. (default: subl)

bangs and nbrowser share the same shell environment, so you can add variables that needed by specific bang to the config file like APIKEYS...

Functions

i made it possible to overwrite two functions: _copy_to_clipboard and _clean_url

the first one as the name indicate is used to copy text to the clipboard, the version that is included in the script use xclip as backend, but you may want to use something else.

the seconde function is _clean_url which try to remove tracking elements from URL, it is very basic, so you may want to improve it or replace it with something better (using ClearURLs rules)

or if you wan't to completely disable it add this to your config file

_clean_url(){
	echo "$@"
}

Browsers

you can add additional browsers by adding something like this to your config file:

browser_count=$((browser_count+1))
installed_browsers[$browser_count]="Browser Name	:	path/to/browser -args"

the $browser_count variable is used to keep track of how many browsers in the list,so you don't accidentally overwrite the list

so every time you want to add a browser you need to add browser_count=$((browser_count+1)) before it like this

browser_count=$((browser_count+1))
installed_browsers[$browser_count]="Browser1 Name	:	path/to/browser1 -args"
browser_count=$((browser_count+1))
installed_browsers[$browser_count]="Browser2 Name	:	path/to/browser2 -args"
browser_count=$((browser_count+1))
installed_browsers[$browser_count]="Browser3 Name	:	path/to/browser3 -args"

and this is an example of how to add a firefox profile to the list

browser_count=$((browser_count+1))
installed_browsers[$browser_count]="Firefox ProfileName	:	$(which firefox) -P profilename"
# pro tips:
- $browser_count variable actually start form 2,
  so you can add a browser to the top without overwriting any item in the list
  installed_browsers[1]="Default Browser	:	path/to/browser -args"
- you can also use installed_browsers[0] by I suggest to keep it to special action like opening an html file or a pdf
- when adding a browser, before and after the colon (:) those are not spaces but tabs (\t), one tab before colon and one after

Search Engines

ENGINES["keyword"]="http://duckduckgo.com/?q="
Clone this wiki locally