google-chrome 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2011 The Chromium Authors. All rights reserved.
  4. # Use of this source code is governed by a BSD-style license that can be
  5. # found in the LICENSE file.
  6. # Let the wrapped binary know that it has been run through the wrapper.
  7. export CHROME_WRAPPER="`readlink -f "$0"`"
  8. HERE="`dirname "$CHROME_WRAPPER"`"
  9. # We include some xdg utilities next to the binary, and we want to prefer them
  10. # over the system versions when we know the system versions are very old. We
  11. # detect whether the system xdg utilities are sufficiently new to be likely to
  12. # work for us by looking for xdg-settings. If we find it, we leave $PATH alone,
  13. # so that the system xdg utilities (including any distro patches) will be used.
  14. if ! which xdg-settings &> /dev/null; then
  15. # Old xdg utilities. Prepend $HERE to $PATH to use ours instead.
  16. export PATH="$HERE:$PATH"
  17. else
  18. # Use system xdg utilities. But first create mimeapps.list if it doesn't
  19. # exist; some systems have bugs in xdg-mime that make it fail without it.
  20. xdg_app_dir="${XDG_DATA_HOME:-$HOME/.local/share/applications}"
  21. mkdir -p "$xdg_app_dir"
  22. [ -f "$xdg_app_dir/mimeapps.list" ] || touch "$xdg_app_dir/mimeapps.list"
  23. fi
  24. # Always use our versions of ffmpeg libs.
  25. # This also makes RPMs find the compatibly-named library symlinks.
  26. if [[ -n "$LD_LIBRARY_PATH" ]]; then
  27. LD_LIBRARY_PATH="$HERE:$HERE/lib:$LD_LIBRARY_PATH"
  28. else
  29. LD_LIBRARY_PATH="$HERE:$HERE/lib"
  30. fi
  31. export LD_LIBRARY_PATH
  32. export CHROME_VERSION_EXTRA="stable"
  33. # We don't want bug-buddy intercepting our crashes. http://crbug.com/24120
  34. export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME
  35. # Sanitize std{in,out,err} because they'll be shared with untrusted child
  36. # processes (http://crbug.com/376567).
  37. exec < /dev/null
  38. exec > >(exec cat)
  39. exec 2> >(exec cat >&2)
  40. # Note: exec -a below is a bashism.
  41. exec -a "$0" "$HERE/chrome" "$@" --no-sandbox -disable-gpu