Skip to content

Instantly share code, notes, and snippets.

@hrdwdmrbl
Created March 30, 2025 19:26
Show Gist options
  • Select an option

  • Save hrdwdmrbl/5695229c19c60eeb059e957710aef7d8 to your computer and use it in GitHub Desktop.

Select an option

Save hrdwdmrbl/5695229c19c60eeb059e957710aef7d8 to your computer and use it in GitHub Desktop.
A shell script for making copies of Firefox. Each copy runs their own profile so that I can have 3 separate sets of cookies.
rm -rf /Applications/Firefox\ H.app
rm -rf /Applications/Firefox\ K.app
rm -rf /Applications/Firefox\ P.app
cp -R /Applications/Firefox.app /Applications/Firefox\ H.app
cp -R /Applications/Firefox.app /Applications/Firefox\ K.app
cp -R /Applications/Firefox.app /Applications/Firefox\ P.app
# Copy icons
cp ~/Applications/Split\ Firefox/horse.icns /Applications/Firefox\ H.app/Contents/Resources/firefox.icns
cp ~/Applications/Split\ Firefox/kigurumi.icns /Applications/Firefox\ K.app/Contents/Resources/firefox.icns
cp ~/Applications/Split\ Firefox/personal.icns /Applications/Firefox\ P.app/Contents/Resources/firefox.icns
# Find replace
sed -i '' 's/\<string>Firefox\<\/string>/\<string>Firefox-Personal\<\/string>/g' /Applications/Firefox\ P.app/Contents/Info.plist
sed -i '' 's/\<string>Firefox\<\/string>/\<string>Firefox-Kigurumi\<\/string>/g' /Applications/Firefox\ K.app/Contents/Info.plist
sed -i '' 's/\<string>Firefox\<\/string>/\<string>Firefox-Horse\<\/string>/g' /Applications/Firefox\ H.app/Contents/Info.plist
sed -i '' 's/\<string>org.mozilla.firefox\<\/string>/\<string>org.mozilla.firefox-personal\<\/string>/g' /Applications/Firefox\ P.app/Contents/Info.plist
sed -i '' 's/\<string>org.mozilla.firefox\<\/string>/\<string>org.mozilla.firefox-kigurumi\<\/string>/g' /Applications/Firefox\ K.app/Contents/Info.plist
sed -i '' 's/\<string>org.mozilla.firefox\<\/string>/\<string>org.mozilla.firefox-horse\<\/string>/g' /Applications/Firefox\ H.app/Contents/Info.plist
# NOTE: May require that you set up your own personal cert. in XCode
codesign --deep --force --sign "MyLocalCodeSignCert" /Applications/Firefox\ H.app
codesign --deep --force --sign "MyLocalCodeSignCert" /Applications/Firefox\ K.app
codesign --deep --force --sign "MyLocalCodeSignCert" /Applications/Firefox\ P.app
@hrdwdmrbl
Copy link
Author

Caveat: To update Firefox, you update the "base" application "Firefox.app" and then re-run this script to create the copies.

@hrdwdmrbl
Copy link
Author

Usage

  1. Create the folder ~/Applications/Split\ Firefox
  2. Copy the script to ~/Applications/Split\ Firefox
  3. Replace FIrefox H, Firefox K and Firefox P in the script with your names.
  4. Set up your images within the folder ~/Applications/Split\ Firefox/ so that the copies will have your icons. Icons are just square pngs with the extension switched to .icns.
  5. Give the script execution permission
  6. Run it!

Note: It may require that you set up your own personal cert in XCode for the codesign to work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment