diff options
Diffstat (limited to 'indra/newview/linux_tools/launch_url.sh')
-rwxr-xr-x | indra/newview/linux_tools/launch_url.sh | 76 |
1 files changed, 35 insertions, 41 deletions
diff --git a/indra/newview/linux_tools/launch_url.sh b/indra/newview/linux_tools/launch_url.sh index d2c8919d46..404ea36f26 100755 --- a/indra/newview/linux_tools/launch_url.sh +++ b/indra/newview/linux_tools/launch_url.sh @@ -7,17 +7,15 @@ # # On Unixoids we try, in order of decreasing priority: # - $BROWSER if set (preferred) -# - kfmclient openURL +# - Default GNOME browser +# - Default KDE browser # - x-www-browser -# - opera -# - firefox -# - mozilla -# - netscape +# - The first browser in $BROWSER_COMMANDS that is found. URL="$1" if [ -z "$URL" ]; then - echo "Usage: $0 URL" + echo "Usage: $(basename "$0") URL" exit fi @@ -47,46 +45,42 @@ if [ ! -z "$XBROWSER" ]; then echo "$0: Trying some others..." fi -# else kfmclient -# (embodies KDE concept of 'preferred browser') -if which kfmclient >/dev/null; then - kfmclient openURL "$URL" & - exit -fi - -# else x-www-browser -# (Debianesque idea of a working X browser) -if which x-www-browser >/dev/null; then - x-www-browser "$URL" & - exit -fi - -# else opera -# (if user has opera in their path, they probably went to the -# trouble of installing it -> prefer it) -if which opera >/dev/null; then - opera "$URL" & +# Launcher the default GNOME browser. +if [ ! -z "$GNOME_DESKTOP_SESSION_ID" ] && which gnome-open >/dev/null; then + gnome-open "$URL" & exit fi -# else firefox -if which firefox >/dev/null; then - firefox "$URL" & +# Launch the default KDE browser. +if [ ! -z "$KDE_FULL_SESSION" ] && which kfmclient >/dev/null; then + kfmclient openURL "$URL" & exit fi -# else mozilla -if which mozilla >/dev/null; then - mozilla "$URL" & - exit -fi - -# else netscape -if which netscape >/dev/null; then - netscape "$URL" & - exit -fi +# List of browser commands that will be tried in the order listed. x-www-browser +# will be tried first, which is a debian alternative. +BROWSER_COMMANDS=" \ + x-www-browser \ + firefox \ + mozilla-firefox \ + iceweasel \ + iceape \ + opera \ + epiphany-browser \ + epiphany-gecko \ + epiphany-webkit \ + epiphany \ + mozilla \ + seamonkey \ + galeon \ + dillo \ + netscape" +for browser_cmd in $BROWSER_COMMANDS; do + if which $browser_cmd >/dev/null; then + $browser_cmd "$URL" & + exit + fi +done echo '$0: Failed to find a known browser. Please consider setting the $BROWSER environment variable.' - -# end. +exit 1 |