Skip to content

Instantly share code, notes, and snippets.

Last active August 30, 2022 13:06
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save stefansundin/c89fd15bae5a58831790 to your computer and use it in GitHub Desktop.
Create Chrome apps in Mac OS.
# wget
# chmod +x
# ./
echo "Note that the app will run with a separate data dir and thus not have your regular extensions and settings."
echo "What should the app be called?"
read name
if [ -d "$HOME/Applications/$" ]; then
echo "That app already exists."
exit 1
echo "What is the url?"
read url
echo "What is the full path to the icon? (optional)"
read icon
chrome="/Applications/Google Chrome"
mkdir -p "$app/Resources" "$app/MacOS" "$app/Profile"
# convert the icon
if [ -f $icon ]; then
sips -s format tiff $icon --out "$app/Resources/icon.tiff" --resampleWidth 128 &> /dev/null
tiff2icns -noLarge "$app/Resources/icon.tiff" &> /dev/null
# create the executable
cat > "$app/MacOS/$name" <<EOF
exec "$chrome" --app="$url" --user-data-dir="$app/Profile" --disable-save-password-bubble "\$@"
chmod +x "$app/MacOS/$name"
# create Info.plist
cat > "$app/Info.plist" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" “”>
<plist version=”1.0″>
# disable Chrome's first-run dialog
touch "$app/Profile/First Run"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment