Browser (Unix)

From Jin

Rationale

Under Windows and Mac OS X, Jin uses special system commands to open URLs in your preferred browser. Because Unix doesn't have a standardized way to invoke the browser, Jin needs you to tell it the command which runs your browser. You do this by setting the BROWSER environment variable. The best way to set it is edit the jin script in Jin's main directory and add the following line after "#!/bin/sh":

export BROWSER='command'

Below is Eric Raymond's suggested standard for the BROWSER variable; that is how Jin interprets it.

The value of BROWSER may consist of a colon-separated series of browser command parts. These should be tried in order until one succeeds. Each command part may optionally contain the string "%s"; if it does, the URL to be viewed is substituted there. If a command part does not contain %s, the browser is to be launched as if the URL had been supplied as its first argument. The string %% must be substituted as a single %.

Rationale: We need to be able to specify multiple browser commands so programs obeying this convention can do the right thing in either X or console environments, trying X first. Specifying multiple commands may also be useful for people who share files like .profile across multiple systems. We need %s because some popular browsers have remote-invocation syntax that requires it. Unless %% reduces to %, it won't be possible to have a literal %s in the string.

Note, however, that currently Jin does only looks at the first command specified by BROWSER.

Values of BROWSER for some popular browsers

  • Firefox (assumes Firefox is already running):
    • Opens in a new tab: firefox -remote openURL(%s,new-tab)
    • Opens in a new window: firefox -remote openURL(%s,new-window)
  • Opera (assumes Opera is already running):
    • Opens in a new page: opera -remote openURL(%s,new-page)
    • Opens in a new window: opera -remote openURL(%s,new-window)
  • Konqueror:
    • Opens in new tab: kfmclient newTab %s
    • Opens in new window: kfmclient openURL %s