Added manpage updates as well as an update to using the gui for opening web content

This commit is contained in:
Brian Evans 2019-11-14 10:10:05 -08:00
parent 9d29acc8e8
commit 24fd98fa9b
4 changed files with 22 additions and 18 deletions

View File

@ -1,6 +1,6 @@
# Bombadillo - a non-web client
# Bombadillo - a non-web browser
Bombadillo is a non-web client for the terminal.
Bombadillo is a non-web browser for the terminal.
![a screenshot of the bombadillo client](bombadillo-screenshot.png)
@ -18,7 +18,7 @@ Support for the following protocols is also available via integration with 3rd p
* http/https
* Web support is opt-in (turned off by default).
* Links can be opened in a user's default web browser when in a graphical environment.
* Web pages can be rendered directly in Bombadillo if [Lynx](https://lynx.invisible-island.net/) is installed on the system to handle the document parsing.
* Web pages can be rendered directly in Bombadillo if [Lynx](https://lynx.invisible-island.net/), [w3m](http://w3m.sourceforge.net/), or [elinks](http://elinks.or.cz/) are installed on the system to handle the document parsing.
## Getting Started
@ -115,7 +115,7 @@ Bombadillo development is largely handled by Sloum, with help from asdf, jboverf
There are many ways to contribute to Bombadillo, including a fair few that don't require knowledge of programming:
- Try out the client and let us know if you have a suggestion for improvement, or if you find a bug.
- Try out the browser and let us know if you have a suggestion for improvement, or if you find a bug.
- Read the documentation and let us know if something isn't well explained, or needs correction.
- Maybe you have a cool logo or some art that you think would look nice.

View File

@ -210,14 +210,6 @@ homeurl
The url that \fBbombadillo\fP navigates to when the program loads or when the \fIhome\fP or \fIh\fP LINE COMMAND is issued. This should be a valid url. If a scheme/protocol is not included, gopher will be assumed.
.TP
.B
lynxmode
Sets whether or not to use lynx as a rendering engine for http/https requests, and display results in \fBbombadillo\fP. Lynx must be installed, and \fIopenhttp\fP must be set to \fItrue\fP. Valid values are \fItrue\fP and \fIfalse\fP.
.TP
.B
openhttp
Tells the client whether or not to try to follow web (http/https) links. If set to \fItrue\fP, \fBbombadillo\fP will try to open these links in a user's default web browser, or render them via lynx, depending on the status of \fIlynxmode\fP and \fIterminalonly\fP settings. Valid values are \fItrue\fP and \fIfalse\fP.
.TP
.B
savelocation
The path to the directory that \fBbombadillo\fP should write files to. This must be a valid filepath for the system, must be a directory, and must already exist.
.TP
@ -227,11 +219,7 @@ The url to use for the LINE COMMANDs \fI?\fP and \fIsearch\fP. Should be a valid
.TP
.B
telnetcommand
Tells the client what command to use to start a telnet session. Should be a valid command, including any flags. The address being navigated to will be added to the end of the command.
.TP
.B
terminalonly
Sets whether web links should handled within \fBbombadillo\fP only, or if they can be opened in a user's external web browser. If \fIopenhttp\fP is true, and this setting is true, web links will be handled within \fBbombadillo\fP only. If \fIlynxmode\fP is also true, web links will be rendered in bombadillo via lynx. If \fIopenhttp\fP is true, \fIlynxmode\fP is disabled, and this setting is disabled, \fBbombadillo\fP will open web links in a user's default web browser. Valid values are \fItrue\fP and \fIfalse\fP.
Tells the browser what command to use to start a telnet session. Should be a valid command, including any flags. The address being navigated to will be added to the end of the command.
.TP
.B
theme
@ -244,6 +232,11 @@ A path to a tls certificate file on a user's local filesystem. Defaults to NULL.
.B
tlskey
A path to a tls key that pairs with the tlscertificate setting, on a user's local filesystem. Defaults to NULL. Both \fItlskey\fP and \fItlscertificate\fP must be set for client certificates to work in gemini.
.TP
.B
webmode
Controls behavior when following web links. The following values are valid: \fInone\fP will disable following web links, \fIgui\fP will have the browser attempt to open web links in a user's default graphical web browser; \fIlynx\fP, \fIw3m\fP, and \fIelinks\fP will have the browser attempt to use the selected terminal web browser to handle the rendering of web pages and will display the pages directly in Bombadillo.
.SH BUGS
There are very likely bugs. Many known bugs can be found in the issues section of \fBbombadillo\fP's source code repository (see \fIlinks\fP).
.SH LINKS

View File

@ -5,6 +5,17 @@ package http
import "os/exec"
func OpenInBrowser(url string) (string, error) {
// Check for a local display server, this is
// not a silver bullet but should help ssh
// connected users on many systems get accurate
// messaging and not spin off processes needlessly
err := exec.Command("type", "Xorg").Run()
if err != nil {
return "", fmt.Errorf("No gui is available, check 'webmode' setting")
}
// Use start rather than run or output in order
// to release the process and not block
err := exec.Command("xdg-open", url).Start()
if err != nil {
return "", err

View File

@ -7,5 +7,5 @@ package http
import "fmt"
func OpenInBrowser(url string) (string, error) {
return "", fmt.Errorf("Unsupported os for browser detection")
return "", fmt.Errorf("Unsupported os for 'webmode' 'gui' setting")
}