Before starting to run this script (for the first time on a new machine), these steps are recommended so that the process doesn't error out midway.
On your local machine:
- If you use
masto install apps from the App Store, login into theApp Storeapplication. - Open the
System Preferencesapplication.- Search for 'Full Disk Access' and add 'Terminal' (if not, the setup script will error out)
- Search for 'File Vault' and turn it on (if not, then the setup script will exit)
- If you are going to use Raycast, open the
System Preferencesapplication.- Search for 'Privacy & Security > Accessibility', and enable/approve for the Terminal app (and later for iTerm once its installed).
The meta script to setup the macos machine from a vanilla OS can be run using the following command:
export GH_USERNAME='vraravam' DOTFILES_BRANCH='master' HOMEBREW_BASE_INSTALL='true'; curl --retry 3 --retry-delay 5 -fsSL "https://raw.githubusercontent.com/${GH_USERNAME}/dotfiles/refs/heads/${DOTFILES_BRANCH}/scripts/fresh-install-of-osx.sh" | zsh; unset HOMEBREW_BASE_INSTALLThis script can be run in an idempotent manner, and will setup oh-my-zsh, homebrew, the dotfiles (this repo), etc. (There is 1 caveat though: on a fresh machine, this script silently fails after the first basic installation.) All these scripts are optimized for fast loading of the shell so that the user can work almost immediately upon starting the app.
Important Note After the above script has completed running successfully, you need to do the following manually
-
Use this gist as a template to create equivalent configuration files with your details and make corresponding changes in
files/--HOME--/.gitconfig-oss.incto reflect the same.Tip: Since these git configurations are deep-merged (latest one wins), you will not want to expose your other client-specific configs or your personal configs like email to the outside world (via this public repo). So, you will want to make these changes in the
${HOME}/.gitconfig-oss.incand not in${HOME}/.gitconfigdirectly. -
Quit and Open the
Terminalapplication.- Goto Preferences > Profiles > Basic > Text (and change the font to 'MesloLGS Nerd Font')
-
Open the
iTerm2application.- Goto Preferences > Profiles > Default > Text (and change the font to 'MesloLGS Nerd Font')
- Goto Preferences > Profiles > Default > Keys > Key Mappings > Presets (and choose 'Natural Text Editing')
- Run
bupcwithin a new Terminal so that the rest of the applications can be installed via Homebrew.
These are optional based on your preferences:
- Open the
System Preferencesapplication.- Search for 'Trackpad' and turn on 'Tap to click' (Note: Apple trackpads are notorious for breaking down if used via a hard-click)
- Search for 'Displays' and set scaling / screen resolution as per your preference
- Search for 'Displays' and turn off 'Automatically adjust brightness'
- Search for 'Control Centre' and turn off battery from showing in the Control Center (nice to have especially if you use the Stats app)
- Search for 'Control Centre' and scroll down to 'Clock options' and change the built-in clock to show as analog to save horizontal space in the top menu bar
- Search for 'Full Disk Access' and add `iTerm', 'Terminal', 'zoom.us'
- Search for 'Keyboard' and enable Keyboard Navigation
- Search for 'Camera' and add 'Brave', 'Firefox', 'Zen', 'zoom.us'
- Search for 'Microphone' and add 'Brave', 'Firefox', 'Zen', 'zoom.us'
- Search for 'Close and restore windows', and uncheck 'Close windows when quitting an application' (this will ensure that iTerm, Terminal, all browsers, etc (whichever have multiple windows open while quitting that application), will restore the same windows and tabs the next time you start that application.)
- Search for 'Default web browser' and set as per your preferences
- Search for 'iCloud' and login and setup Desktop sync
- Open the
Finderapplication and manually adjust the Finder sidebar preferences
Continuing the setup process
- If you are using my keybase-based setup to backup your personal files/settings, make sure that you have logged into
Keybaseeither via the application or the command-line. The script will prompt you to login using its in-built cli if you haven't done so. - Rerun the
fresh-install-of-osx.shscript. This portion of the script will setup the home folder repo, the browser profiles, resurrect the repositories that you have created a registry for, install all the programming languages (each specific version of each language) using mise, apply some OSX defaults and finally re-import your preferences (that were captured from the old machine) using the capture-prefs script. If you had captured the Raycast preferences, then you can re-import them using theimport settingsoption in the Raycast application's UI.
Important Note After the above script has completed running successfully, you need to do the following manually if you hadn't captured the Raycast preferences (otherwise, you can skip these steps):
- Open the
Raycastapplication.- If you are using Raycast, then turn off Spotlight from being triggered with the
Cmd+Spaceshortcut since you would want this key combo to trigger Raycast itself. This can be done in theSystem Preferencesapplication - search for 'Keyboard shortcuts', click on the button 'Keyboard shortcuts' and then go to 'Spotlight' on the left, and uncheckShow Spotlight search. - Setup the preferences and keyboard shortcuts as per your choices within Raycast. (I have setup for Clipboard history, Window management and Import/Export of the Raycast settings.) Hint: If you had exported the configs into a file and had captured it as part of your home git repo, then simply re-importing will be sufficient on the new machine.
- I switched to using the 'Coffee' extension of Raycast instead of the KeepingYouAwake standalone app. If you want this functionality, you might also want to install that extension within Raycast's preferences.
- If you are using Raycast, then turn off Spotlight from being triggered with the
Back to the readme