]> git.pld-linux.org Git - packages/chromium-browser.git/blob - chromium-browser.sh
- add way to setup runtime flag options globally (similar to gentoo/debian)
[packages/chromium-browser.git] / chromium-browser.sh
1 #!/bin/sh
2
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
9
10 # Always use our ffmpeg libs.
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
26 fi
27
28 # Set CHROME_VERSION_EXTRA visible in the About dialog and in about:version
29 export CHROME_VERSION_EXTRA="PLD Linux"
30
31 # Let the wrapped binary know that it has been run through the wrapper
32 export CHROME_WRAPPER="$(readlink -f "$0")"
33
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.
36 # See: http://peter.sh/experiments/chromium-command-line-switches/
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
40         CHROMIUM_USER_FLAGS=$(grep -v '^#' "$CHROME_FLAGS_FILE")
41 fi
42
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
47 # Google guys cannot properly handle comma, so download speed/est is shown
48 # as not a number (NaN). Workaround that with LC_NUMERIC=C
49 export LC_NUMERIC=C
50
51 exec @libdir@/chromium-browser $CHROMIUM_FLAGS "$@"
This page took 0.407325 seconds and 4 git commands to generate.