aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/chromium-launcher.sh
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-09-30 13:11:25 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-09-30 13:11:25 +0200
commitaa03363e4923e2745456359019c2dc08089ab446 (patch)
tree1ea625f4f9c1da39c97ddffde2bc08b3589f1bf9 /community/chromium/chromium-launcher.sh
parentf8f12a1762ad21637c24bf91b05725e792871b0f (diff)
downloadaports-aa03363e4923e2745456359019c2dc08089ab446.tar.bz2
aports-aa03363e4923e2745456359019c2dc08089ab446.tar.xz
community/chromium: move from main
Diffstat (limited to 'community/chromium/chromium-launcher.sh')
-rw-r--r--community/chromium/chromium-launcher.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/community/chromium/chromium-launcher.sh b/community/chromium/chromium-launcher.sh
new file mode 100644
index 0000000000..b001d6fe59
--- /dev/null
+++ b/community/chromium/chromium-launcher.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Allow the user to override command-line flags, bug #357629.
+# This is based on Debian's chromium-browser package, and is intended
+# to be consistent with Debian.
+for f in /etc/chromium/*.conf; do
+ [ -f ${f} ] && . "${f}"
+done
+
+# Prefer user defined CHROMIUM_USER_FLAGS (from env) over system
+# default CHROMIUM_FLAGS (from /etc/chromium/default).
+CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"}
+
+# Let the wrapped binary know that it has been run through the wrapper
+export CHROME_WRAPPER=$(readlink -f "$0")
+
+PROGDIR=${CHROME_WRAPPER%/*}
+
+case ":$PATH:" in
+ *:$PROGDIR:*)
+ # $PATH already contains $PROGDIR
+ ;;
+ *)
+ # Append $PROGDIR to $PATH
+ export PATH="$PATH:$PROGDIR"
+ ;;
+esac
+
+if [ $(id -u) -eq 0 ] && [ $(stat -c %u -L ${XDG_CONFIG_HOME:-${HOME}}) -eq 0 ]; then
+ # Running as root with HOME owned by root.
+ # Pass --user-data-dir to work around upstream failsafe.
+ CHROMIUM_FLAGS="--user-data-dir=${XDG_CONFIG_HOME:-${HOME}/.config}/chromium
+ ${CHROMIUM_FLAGS}"
+fi
+
+# Set the .desktop file name
+export CHROME_DESKTOP="chromium.desktop"
+
+exec "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/nsbrowser/plugins ${CHROMIUM_FLAGS} "$@"