Code: Select all
#!/bin/ash
exec mozstart "$@"
mozstart doesn't seem to be defined in woofCE. Anyway, I chose for TazPup64 to use defaultbrowser as a way of defining browser preferences.
Code: Select all
if [ "$TEXTDOMAIN" = 'tazpanel' ]; then
BROWSER_CHOICES=( tazweb midori palemoon firefox opera iron chomium chrome netsurf lynx )
else
BROWSER_CHOICES=( opera palemoon firefox tazweb midori iron chomium chrome netsurf lynx )
fi
When "$TEXTDOMAIN" = 'tazpanel' then we call a lightweight browser, otherwise we call a full featured browser.
What I want to focus on here is the seciton for firefox:
Code: Select all
for BROWSER_OPTION in "${BROWSER_CHOICES[@]}"; do
case "$BROWSER_OPTION" in
...
firefox*)
...
elif [ ! -z `which "$BROWSER_OPTION"` ]; then #we expect $BROWSER_OPTION to be either firefox or firefox-official
CMD="$BROWSER_OPTION"
elif [ ! -z "which firefox" ]; then
CMD=firefox
else
continue
fi
if [ -h "$CMD" ]; then
CMD=`readlink "$CMD"`
fi
if [ ! -z "`which apulse`" ] && [ $(file $CMD | grep -c ELF ) -gt 0 ]; then
CMD="apulse $CMD"
fi
exec $CMD "$@"
;;
The idea here is that if BROWSER_OPTION points to a binary and apulse exists in the system then we call firefox with apulse, otherwise we assume that the script which the command points to decides properly whether or not apulse is needed.