From fd04fa9f400ff0f06a4d9861912333ed39f4e188 Mon Sep 17 00:00:00 2001
From: Will Gant <w_gant@protonmail.com>
Date: Mon, 8 Aug 2022 21:35:40 +0100
Subject: [PATCH] Update README.md

---
 README.md | 87 +++++++++++++++++++++++--------------------------------
 1 file changed, 36 insertions(+), 51 deletions(-)

diff --git a/README.md b/README.md
index 8b8589a..58829b5 100644
--- a/README.md
+++ b/README.md
@@ -1,55 +1,40 @@
 # Mac setup
 
-Run the following to download the latest release of this repo and then run the setup script:
-
-```bash
-setup_repo="$(mktemp -d)"
-zipball_url="$(curl -s https://api.github.com/repos/will-gant/mac-setup/releases/latest | grep zipball_url | cut -d '"' -f 4)"
-zip_file="${setup_repo}/repo.zip"
-curl --location "$zipball_url" --output "${setup_repo}/repo.zip"
-unzip "$zip_file" -d "$setup_repo"
-bash "$setup_repo/*mac-setup*/setup.sh"
-```
-
-## Manual steps:
-
-These should be run _after_ the setup script completes.
-
-### SSH key
-
-1. Retrieve SSH private key from password manager
-1. Copy it into ~/.ssh/id_rsa
+1. Install commandline developer tools:
+    ```
+    touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress;
+    xcode_version="$(softwareupdate --list | grep -E --only-matching "Command Line Tools for Xcode-[0-9]+\.[0-9]+" | tail -n 1)"
+    softwareupdate --install "$xcode_version" --verbose
+    rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
+    ```
+1. [Install brew](https://brew.sh/) (requires sudo)
+1. Run the following to download the latest release of this repo and then run the setup script:
+    ```bash
+       setup_repo="$(mktemp -d)"
+       zipball_url="$(curl -s https://api.github.com/repos/will-gant/mac-setup/releases/latest | grep zipball_url | cut -d '"' -f 4)"
+       zip_file="${setup_repo}/repo.zip"
+       curl --location "$zipball_url" --output "${setup_repo}/repo.zip"
+       unzip "$zip_file" -d "$setup_repo"
+       bash "$setup_repo/*mac-setup*/setup.sh"
+    ```
+1. Retrieve SSH private key from password manager and copy it into ~/.ssh/id_rsa
 1. Run `eval "$(ssh-agent -s)"`
 1. Run `ssh-add --apple-use-keychain ~/.ssh/id_rsa`
-
-### iterm
-
-Import `iterm2.json` as a profile via the iterm GUI
-
-### VScode
-
-Switch on 'sync' and login with GitHub
-
-### System settings
-
-NB. These take effect after a restart
-
-```bash
-
-# updates
-sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool true
-sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true
-sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true
-sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
-sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true
-sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool true
-
-# enable firewall
-sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 2
-
-# enable FileVault encryption (interactive)
-sudo fdesetup enable
-
-# show bluetooth in menu bar
-sudo defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter.plist Bluetooth -int 18
-```
+1. Start iterm2 and import `iterm2.json` as a profile via the iterm GUI
+1. Start Visual Studio Code and sync settings by logging in with GitHub Auth
+1. Run the following to update system settings: 
+    ```bash
+    
+    sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool true
+    sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true
+    sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true
+    sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
+    sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true
+    sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool true
+    # enable firewall
+    sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 2
+    # enable FileVault encryption (interactive)
+    sudo fdesetup enable
+    # show bluetooth in menu bar
+    sudo defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter.plist Bluetooth -int 18
+    ```