6 # Fabien Tassin <fta@sofaraway.org>
7 # Modified: Balwinder S "bsd" Dheeman (bdheeman AT gmail.com)
8 # for adaption on ArchLinux, Gentoo, Slackware and T2
9 # License: GPLv2 or later
11 APPNAME
=chromium-browser
12 LIBDIR
=/opt
/chromium-browser
16 echo "$APPNAME [-h|--help] [-g|--debug] [options] [URL]"
18 echo " -g or --debug Start within $GDB"
19 echo " -h or --help This help screen"
21 echo " Other supported options are:"
22 MANWIDTH
=80 man chromium-browser |
sed -e '1,/OPTIONS/d; /ENVIRONMENT/,$d'
23 echo " See 'man chromium-browser' for more details"
26 if [ -f /etc
/$APPNAME/default
] ; then
27 .
/etc
/$APPNAME/default
30 # Prefer user defined CHROMIUM_USER_FLAGS (fron env) over system
31 # default CHROMIUM_FLAGS (from /etc/$APPNAME/default)
32 CHROMIUM_FLAGS
=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"}
34 # FFmpeg needs to know where its libs are located
35 if [ "Z$LD_LIBRARY_PATH" != Z
] ; then
36 LD_LIBRARY_PATH
=$LIBDIR:$LD_LIBRARY_PATH
38 LD_LIBRARY_PATH
=$LIBDIR:/lib
:/usr
/lib
:/usr
/local
/lib
40 export LD_LIBRARY_PATH
42 # For the Default Browser detection to work, we need to give access
43 # to xdg-settings. Also set CHROME_WRAPPER in case xdg-settings is
44 # not able to do anything useful
45 export PATH
="$LIBDIR:$PATH"
46 export CHROME_WRAPPER
=true
49 while [ $# -gt 0 ]; do
57 -- ) # Stop option prcessing
65 if [ $want_debug -eq 1 ] ; then
66 if [ ! -x $GDB ] ; then
67 echo "Sorry, can't find usable $GDB. Please install it."
70 tmpfile
=`mktemp /tmp/chromiumargs.XXXXXX` ||
{ echo "Cannot create temporary file" >&2; exit 1; }
71 trap " [ -f \"$tmpfile\" ] && /bin/rm -f -- \"$tmpfile\"" 0 1 2 3 13 15
72 echo "set args $CHROMIUM_FLAGS ${1+"$@"}" > $tmpfile
74 echo "# LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
76 echo "# GTK_PATH=$GTK_PATH"
77 echo "# CHROMIUM_USER_FLAGS=$CHROMIUM_USER_FLAGS"
78 echo "# CHROMIUM_FLAGS=$CHROMIUM_FLAGS"
79 echo "$GDB $LIBDIR/chrome -x $tmpfile"
80 $GDB "$LIBDIR/chrome" -x $tmpfile
83 exec $LIBDIR/chrome
$CHROMIUM_FLAGS "$@"