]>
Commit | Line | Data |
---|---|---|
bd7a3039 ER |
1 | #!/bin/sh |
2 | ||
37ceaf05 ER |
3 | # Allow the user to override command-line flags, http://bugs.gentoo.org/357629 |
4 | # This is based on Debian's chromium-browser package, and is intended | |
5 | # to be consistent with Debian. | |
6 | if [ -f /etc/chromium-browser/default ] ; then | |
7 | . /etc/chromium-browser/default | |
8 | fi | |
4edced9c ER |
9 | |
10 | # Always use our ffmpeg libs. | |
4edced9c ER |
11 | export LD_LIBRARY_PATH=@libdir@${LD_LIBRARY_PATH:+:"$LD_LIBRARY_PATH"} |
12 | ||
13 | # for to find xdg-settings | |
14 | export PATH=@libdir@${PATH:+:"$PATH"} | |
15 | ||
16 | # chromium needs /dev/shm being mounted | |
17 | m=$(awk '$2 == "/dev/shm" && $3 == "tmpfs" {print}' /proc/mounts) | |
18 | if [ -z "$m" ]; then | |
19 | cat >&2 <<-'EOF' | |
20 | Chromium needs /dev/shm being mounted for Shared Memory access. | |
21 | ||
22 | To do so, invoke (as root): | |
23 | mount -t tmpfs -o rw,nosuid,nodev,noexec none /dev/shm | |
24 | ||
25 | EOF | |
bd7a3039 | 26 | fi |
4edced9c ER |
27 | |
28 | # Set CHROME_VERSION_EXTRA visible in the About dialog and in about:version | |
29 | export CHROME_VERSION_EXTRA="PLD Linux" | |
30 | ||
a153aaeb AM |
31 | # Let the wrapped binary know that it has been run through the wrapper |
32 | export CHROME_WRAPPER="$(readlink -f "$0")" | |
33 | ||
aa6a00d6 ER |
34 | # Google Chrome has a number of command line switches which change the behavior of Chrome |
35 | # This param allows you to set extra args for browser startup. | |
1693275a | 36 | # See: http://peter.sh/experiments/chromium-command-line-switches/ |
aa6a00d6 ER |
37 | CHROME_FLAGS_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/chromium/Chrome Flags" |
38 | if [ -f "$CHROME_FLAGS_FILE" ]; then | |
39 | # All lines starting with # are ignored | |
37ceaf05 | 40 | CHROMIUM_USER_FLAGS=$(grep -v '^#' "$CHROME_FLAGS_FILE") |
aa6a00d6 ER |
41 | fi |
42 | ||
37ceaf05 ER |
43 | # Prefer user defined CHROMIUM_USER_FLAGS (from env) over system |
44 | # default CHROMIUM_FLAGS (from /etc/chromium-browser/default). | |
45 | CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"} | |
46 | ||
1693275a | 47 | # Google guys cannot properly handle comma, so download speed/est is shown |
6a2c5f4d | 48 | # as not a number (NaN). Workaround that with LC_NUMERIC=C |
1693275a | 49 | export LC_NUMERIC=C |
6a2c5f4d | 50 | |
37ceaf05 | 51 | exec @libdir@/chromium-browser $CHROMIUM_FLAGS "$@" |