File: xfbrowser4.in

package info (click to toggle)
xfce4-utils 4.4.2-8
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 3,388 kB
  • ctags: 155
  • sloc: sh: 9,593; xml: 1,457; ansic: 1,312; makefile: 330
file content (59 lines) | stat: -rw-r--r-- 1,061 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh

if [ "x$BROWSER" = "x" ]
then
  for b in exo-open @BROWSER_DEFAULT@ firefox epiphany galeon mozilla konqueror dillo
  do
    if which "$b" > /dev/null 2>&1
    then
      BROWSER=$b
      break;
    fi
  done
fi

if [ "x$BROWSER" = "x" ]
then
  echo " *** Error ***: xfbrowser4: Could not find browser to use."
  echo "                Please set the BROWSER variable."
  exit 1
fi

if [ ! "x$1" = "x" ]; then
  case $1 in
      *://*) URL=$1;;
      *) URL="file://$1" ;;
  esac
fi

case $BROWSER in
    firefox*)
	$BROWSER -a firefox -remote openurl\($URL,new-window\) || \
		$BROWSER $URL
	;;
    communicator*|netscape|mozilla*|phoenix*|firebird*)
	$BROWSER -remote openurl\($URL,new-window\) || \
		$BROWSER $URL    
	;;
    opera*)
    	$BROWSER -remote openURL\($URL,new-window\) || \
		$BROWSER $URL
	;;
	exo-open)
	    $BROWSER --launch WebBrowser $URL
	;;
    *)
    	$BROWSER $URL
	;;
esac

if [ $? -ne 0 ]; then
	xmessage -center -file - -title Error <<EOF
Unable to execute browser. 
Online help is not available.
EOF
	exit 1
fi

exit 0