chromium-browser-vine.sh 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #!/bin/sh
  2. # Chromium launcher
  3. # Authors:
  4. # Fabien Tassin <fta@sofaraway.org>
  5. # License: GPLv2 or later
  6. APPNAME=chromium
  7. LIBDIR=/usr/lib/chromium
  8. GDB=/usr/bin/gdb
  9. CHROME_SANDBOX=/usr/lib/chrome_sandbox
  10. # # Let the Chromium aware MeeGo desktop environment.
  11. # # For system proxy setting integration.
  12. # GNOME_DESKTOP_SESSION_ID="this-is-deprecated"
  13. # export GNOME_DESKTOP_SESSION_ID
  14. usage () {
  15. echo "$APPNAME [-h|--help] [-g|--debug] [options] [URL]"
  16. echo
  17. echo " -g or --debug Start within $GDB"
  18. echo " -h or --help This help screen"
  19. }
  20. # FFmpeg needs to know where its libs are located
  21. if [ "Z$LD_LIBRARY_PATH" != Z ] ; then
  22. LD_LIBRARY_PATH=$LIBDIR:$LD_LIBRARY_PATH
  23. else
  24. LD_LIBRARY_PATH=$LIBDIR
  25. fi
  26. export LD_LIBRARY_PATH
  27. # xdg-settings should in PATH
  28. PATH=$PATH:$LIBDIR
  29. export PATH
  30. want_debug=0
  31. while [ $# -gt 0 ]; do
  32. case "$1" in
  33. -h | --help | -help )
  34. usage
  35. exit 0 ;;
  36. -g | --debug )
  37. want_debug=1
  38. shift ;;
  39. -- ) # Stop option prcessing
  40. shift
  41. break ;;
  42. * )
  43. break ;;
  44. esac
  45. done
  46. # # Set plugin search path. Chromium will read mozilla's plugin
  47. # # search path. This is for platforms (handset, TV, etc..) where
  48. # # plugins are not copied/linked to the standard mozilla plugin
  49. # # path due to reasons. PDF plugin is in the list though it is
  50. # # not really supported by chromium on Linux.
  51. # moz_plugin_path=$(find /usr/java/jre* \
  52. # /usr/lib/flash-plugin \
  53. # /opt/Adobe* /usr/Adobe* \
  54. # -name "libnpjp2.so" -exec dirname {} \; -o \
  55. # -name "libflashplayer.so" -exec dirname {} \; -o \
  56. # -name "nppdf.so" -exec dirname {} \; 2>/dev/null | xargs echo)
  57. # MOZ_PLUGIN_PATH=$MOZ_PLUGIN_PATH:${moz_plugin_path// /:}
  58. # export MOZ_PLUGIN_PATH
  59. # Setup the default profile if this is none
  60. # Set the default theme as GTK+ with system window decoration
  61. if [ ! -d ~/.config/chromium/Default ]; then
  62. mkdir -p ~/.config/chromium/Default
  63. cat <<EOF > ~/.config/chromium/Default/Preferences
  64. {
  65. "browser": {
  66. "custom_chrome_frame": false
  67. },
  68. "extensions": {
  69. "theme": {
  70. "colors": {
  71. },
  72. "id": "",
  73. "images": {
  74. },
  75. "properties": {
  76. },
  77. "tints": {
  78. },
  79. "use_system": true
  80. }
  81. },
  82. "homepage": "http://meego.com/",
  83. "homepage_is_newtabpage": false,
  84. "session": {
  85. "restore_on_startup": 1
  86. },
  87. "webkit": {
  88. "webprefs": {
  89. "default_fixed_font_size": 13,
  90. "default_font_size": 16,
  91. "fixed_font_family": "Droid Sans Mono",
  92. "sansserif_font_family": "Droid Sans",
  93. "serif_font_family": "Droid Serif"
  94. }
  95. }
  96. }
  97. EOF
  98. # # Set the default browser
  99. # $LIBDIR/xdg-settings set default-web-browser chromium-browser.desktop
  100. fi
  101. if [ ! -u $CHROME_SANDBOX ] ; then
  102. SANDBOX="--no-sandbox"
  103. fi
  104. if [ $want_debug -eq 1 ] ; then
  105. if [ ! -x $GDB ] ; then
  106. echo "Sorry, can't find usable $GDB. Please install it."
  107. exit 1
  108. fi
  109. tmpfile=`mktemp /tmp/chromiumargs.XXXXXX` || { echo "Cannot create temporary file" >&2; exit 1; }
  110. trap " [ -f \"$tmpfile\" ] && /bin/rm -f -- \"$tmpfile\"" 0 1 2 3 13 15
  111. echo "set args ${1+"$@"}" > $tmpfile
  112. echo "# Env:"
  113. echo "# LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
  114. echo "$GDB $LIBDIR/$APPNAME -x $tmpfile"
  115. $GDB "$LIBDIR/$APPNAME" -x $tmpfile
  116. exit $?
  117. else
  118. exec $LIBDIR/$APPNAME $SANDBOX "--password-store=detect" "--enable-experimental-extension-apis" "--enable-plugins" "--enable-extensions" "--enable-user-scripts" "--enable-printing" "--enable-sync" "--auto-ssl-client-auth" "$@"
  119. fi