1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # browser_select.zprofile: Setup $BROWSER for the "best" available WWW browser
4 # Don't run this plugin on "check-plugins"!
5 [[ -z "$AXZSH_PLUGIN_CHECK" ]] || return 92
8 if [[ -z "$BROWSER" ]]; then
9 if [[ "$OSTYPE" != "linux-gnu" ]]; then
10 # Check for open(1) on Non-Linux systems. On (Debian-) Linux, the open(1)
11 # command would recursively call $BROWSER (=itself) ...
14 if [[ -n "$DISPLAY" ]]; then
15 # X11 available, consider X11-based browsers, too!
16 x11_browsers="firefox chrome"
19 # Note: We can't use xdg-open(1) here, as xdg-open itself tries to use
20 # $BROWSER, and this would result in an endless loop!
24 elinks w3m links2 links lynx
26 if [[ -n "$commands[$browser]" ]]; then
27 BROWSER="$commands[$browser]"
31 unset browser open_browser x11_browsers
34 [[ -n "$BROWSER" ]] && export BROWSER