|
|
Surfraw gets its configuration from three sources, in order:
|
|
|
|
|
|
1. Environment variables
|
|
|
2. `/etc/surfraw.conf`
|
|
|
3. `$HOME/.surfraw.conf`
|
|
|
|
|
|
`/etc/surfraw.conf` and `$HOME/.surfraw.conf` are both fragments of bourne-shell style shell script.
|
|
|
|
|
|
`/etc/surfraw.conf` should use `def` and `defyn` to define variables. These functions set variables unless they are already set by the environment. `defyn` is used for boolean configuration variables, `def` for all others. For instance:
|
|
|
|
|
|
````
|
|
|
def SURFRAW_text_browser /usr/bin/lynx
|
|
|
defyn SURFRAW_graphical no
|
|
|
````
|
|
|
|
|
|
`$HOME/.surfraw.conf` should use sh-style entries, eg:
|
|
|
|
|
|
````
|
|
|
SURFRAW_text_browser=/usr/bin/lynx
|
|
|
SURFRAW_graphical=no
|
|
|
````
|
|
|
|
|
|
This is because you want them to override environment variables unconditionally.
|
|
|
|
|
|
## Configuration Variables
|
|
|
|
|
|
| Variable | Meaning | Default |
|
|
|
|-------------------------------- |----------------------------------------------------------------------------------------------------------------------------------------------- |----------------------- |
|
|
|
| SURFRAW_global_conf | Location of global configuration file. | `/etc/surfraw.conf` |
|
|
|
| SURFRAW_conf | Location of per-user configuration file. | `$HOME/.surfraw.conf` |
|
|
|
| SURFRAW_graphical | Whether to use a graphical browser. | no |
|
|
|
| SURFRAW_text_browser | Name/path of text browser executable.e.g. links, lynx, w3m | sensible-browser |
|
|
|
| SURFRAW_graphical_browser | Name/path of graphical browser executable.e.g firefox, qutebrowser, etc. | sensible-browser |
|
|
|
| SURFRAW_text_browser_args | Text browser arguments, or "none". | none |
|
|
|
| SURFRAW_graphical_browser_args | Graphical browser arguments, or "none". | none |
|
|
|
| SURFRAW_graphical_remote | Whether to use -remote openURL for graphical browser. | yes |
|
|
|
| SURFRAW_new_window | When using SURFRAW_graphical_remote, open a new window? | no |
|
|
|
| SURFRAW_screen | Name of screen command to run. | screen |
|
|
|
| SURFRAW_screen_args | Arguments to screen command | |
|
|
|
| SURFRAW_new_screen | If surfraw is running under screen(1), start a new screen for each text browser invocation? | no |
|
|
|
| SURFRAW_quiet | I can't enjoy it with you talking all the time. | no |
|
|
|
| SURFRAW_quote_args | Whether to "quote" all the arguments. | no |
|
|
|
| SURFRAW_quote_ifs | Whether to re-quote arguments if they have spaces in, ie so: `sr google foo "bar baz" bam` works as expected. | yes |
|
|
|
| SURFRAW_results | Default number of results to return (not supported by all elvi). | 30 |
|
|
|
| SURFRAW_escape_url_args | Whether to escape [%"$%&+,/:;<=>?@[\^{}~'] characters in command line arguments subsequently used to construct a url. | yes |
|
|
|
| SURFRAW_lang | Elvi supporting this will use it to select a default country or language. It should be set to an ISO 2-letter country code (e.g. uk, de, ca). | none |
|
|
|
| SURFRAW_customsearch_provider | Provider for searches that use a search engine. Supported: google, duckduckgo. | duckduckgo |
|
|
|
|
|
|
## Files
|
|
|
|
|
|
* `$(libdir)/surfraw`
|
|
|
Location of the elvi.
|
|
|
* `/etc/surfraw.conf`
|
|
|
Default system wide configuration file.
|
|
|
* `$HOME/.surfraw.conf`
|
|
|
Default per-user config file
|
|
|
* `/etc/surfraw.bookmarks`
|
|
|
System wide bookmarks file.
|
|
|
* `$HOME/.surfraw.bookmarks`
|
|
|
Per-user bookmarks file. |
|
|
\ No newline at end of file |