Guest User

Untitled

a guest
Jul 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. #! /bin/bash
  2. #
  3. # Put this script in ~/bin/google-chrome for example, then create
  4. # a symlink to start using it, for example:
  5. #
  6. # shell% cd bin
  7. # shell% ln -s google-chrome google-chrome-test
  8. # shell% ./google-chrome-test
  9.  
  10. # Try to locate Google Chrome
  11. GOOGLE_CHROME=
  12. if [ -x "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" ]
  13. then
  14. GOOGLE_CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
  15. fi
  16. if [ -x "/Users/$USER/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" ]
  17. then
  18. GOOGLE_CHROME="/Users/$USER/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
  19. fi
  20. if [ -z "${GOOGLE_CHROME}" ]
  21. then
  22. echo "Could not locate the Google Chrome.app binary" >&2
  23. exit 1
  24. fi
  25.  
  26. # Check if we are called by a symlink
  27. PROFILE_NAME=$(basename "$0" | sed -e 's/^google-chrome-//')
  28. if [ "${PROFILE_NAME}" = "google-chrome" ]; then
  29. cat <<EOF
  30. Please create a symlink to this script to start using multiple
  31. Google Chrome profiles, it should be a matter of executing
  32. something like:
  33.  
  34. shell% ln -s $0 $0-name
  35.  
  36. Where "name" is the name of the new profile.
  37. EOF
  38. exit 1
  39. fi
  40.  
  41. # Profile directory
  42. USER_DIR="/Users/${USER}/Library/Application Support/Google/Chrome/${PROFILE_NAME}"
  43. echo "Using ${USER_DIR}"
  44.  
  45. # Execute Google Chrome (in the background)
  46. exec "${GOOGLE_CHROME}" \
  47. --enable-udd-profiles \
  48. --user-data-dir="${USER_DIR}" &
Add Comment
Please, Sign In to add comment