6 # Fabien Tassin <fta@sofaraway.org>
7 # License: GPLv2 or later
10 LIBDIR
=/usr
/lib
/chromium
14 echo "$APPNAME [-h|--help] [-g|--debug] [options] [URL]"
16 echo " -g or --debug Start within $GDB"
17 echo " -h or --help This help screen"
19 echo " Other supported options are:"
20 MANWIDTH
=80 man chromium-browser |
sed -e '1,/OPTIONS/d; /ENVIRONMENT/,$d'
21 echo " See 'man chromium-browser' for more details"
24 # Prefer user defined CHROMIUM_USER_FLAGS (fron env) over system
25 # default CHROMIUM_FLAGS (from /etc/$APPNAME/default)
26 CHROMIUM_FLAGS
=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"}
28 # FFmpeg needs to know where its libs are located
29 if [ "Z$LD_LIBRARY_PATH" != Z
] ; then
30 LD_LIBRARY_PATH
=$LIBDIR:$LD_LIBRARY_PATH
32 LD_LIBRARY_PATH
=$LIBDIR
34 export LD_LIBRARY_PATH
36 # For the Default Browser detection to work, we need to give access
37 # to xdg-settings. Also set CHROME_WRAPPER in case xdg-settings is
38 # not able to do anything useful
39 export PATH
="$LIBDIR:$PATH"
40 export CHROME_WRAPPER
=true
42 # Set CHROME_VERSION_EXTRA visible in the About dialog and in about:version
43 export CHROME_VERSION_EXTRA
=Archlinux
46 while [ $# -gt 0 ]; do
54 -- ) # Stop option prcessing
62 if [ $want_debug -eq 1 ] ; then
63 if [ ! -x $GDB ] ; then
64 echo "Sorry, can't find usable $GDB. Please install it."
67 tmpfile
=`mktemp /tmp/chromiumargs.XXXXXX` ||
{ echo "Cannot create temporary file" >&2; exit 1; }
68 trap " [ -f \"$tmpfile\" ] && /bin/rm -f -- \"$tmpfile\"" 0 1 2 3 13 15
69 echo "set args $CHROMIUM_FLAGS ${1+"$@"}" > $tmpfile
71 echo "# LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
73 echo "# GTK_PATH=$GTK_PATH"
74 echo "# CHROMIUM_USER_FLAGS=$CHROMIUM_USER_FLAGS"
75 echo "# CHROMIUM_FLAGS=$CHROMIUM_FLAGS"
76 echo "$GDB $LIBDIR/$APPNAME -x $tmpfile"
77 $GDB "$LIBDIR/$APPNAME" -x $tmpfile
80 exec $LIBDIR/$APPNAME $CHROMIUM_FLAGS "$@"