diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-04-18 16:38:57 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-04-18 16:38:57 +0100 |
commit | 06ed7b60c6b20f9251be0a7c51733338d0b222e9 (patch) | |
tree | f6c880e34a99527989583b7d31a91454a1b2a11f /www-client/chromium/files/chromium-launcher-r3.sh | |
parent | baf59ad449bfa1aa61213c7f93da38ce3245d00f (diff) |
www-client/chromium : import from portage tree
Diffstat (limited to 'www-client/chromium/files/chromium-launcher-r3.sh')
-rw-r--r-- | www-client/chromium/files/chromium-launcher-r3.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/www-client/chromium/files/chromium-launcher-r3.sh b/www-client/chromium/files/chromium-launcher-r3.sh new file mode 100644 index 00000000..a4fc1a95 --- /dev/null +++ b/www-client/chromium/files/chromium-launcher-r3.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# 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/*; do + [[ -f ${f} ]] && source "${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 [[ ${EUID} == 0 && -O ${XDG_CONFIG_HOME:-${HOME}} ]]; 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-browser-chromium.desktop" + +exec -a "chromium-browser" "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/nsbrowser/plugins ${CHROMIUM_FLAGS} "$@" |