Creating Self-Contained Google Chrome App

Sick of opening different Google Chrome windows for work and private accounts? I use following script to create a separate standalone Chrome app for that. Take a look at the code and give it a spin. This is for Mac ONLY!!!


#!/bin/sh

echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name="$inputline"

echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url="$inputline"

echo "What is the full path to the icon (e.g. /Users/username/Desktop/icon.png)?"
read inputline
icon="$inputline"

chromePath="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
appRoot="/Users/$USER/Applications"

# various paths used when creating the app
resourcePath="$appRoot/$name.app/Contents/Resources"
execPath="$appRoot/$name.app/Contents/MacOS"
profilePath="$appRoot/$name.app/Contents/Profile"
plistPath="$appRoot/$name.app/Contents/Info.plist"

# make the directories
mkdir -p "$resourcePath" "$execPath" "$profilePath"

# convert the icon and copy into Resources
if [ -f "$icon" ] ; then
sips -s format tiff "$icon" --out "$resourcePath/icon.tiff" --resampleHeightWidth 128 128 >& /dev/null
tiff2icns -noLarge "$resourcePath/icon.tiff" >& /dev/null
fi

# create the executable
cat >"$execPath/$name" < "$plistPath" <

CFBundleExecutable
$name
CFBundleIconFile
icon
EOF