chromium-browser-vine.sh 3.3 KB

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