Kategorien
IT life

Setup your mac – the zero touch way

My 2017 MacBook Pro was getting slower over the time, and with everything in my Dropbox and in the iCloud backup, I dared to do a fresh install. I read about scripting your MacBook setup a while ago, so the nerd in me went down that road – and we went well.

With the help of „brew“ and „mas“ I put together a setup a bash script, which sets up your Mac nearly zero touch. and here it goes:

  1. We start with checking, if the script has already run.
#!/usr/bin/env bash

if [ -f ~/.osx-bootstrapped.txt ]; then
  cat << EOF
~/.osx-bootstrapped.txt FOUND!
This laptop has already been bootstrapped
Exiting. No changes were made.
EOF
  exit 0
fi

2. We are going to install brew, for some of the essential apps

# Install Brew
if [[ ${BREWINSTALLED} == "" ]]; then
  echo "Installing Brew"
  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi

3. Now these are the apps I like to set up. You’ll find a list over at brews.

#Required App
brew tap homebrew/cask
brew install mas
brew install --cask google-chrome
brew install --cask slack
brew install --cask spotify
brew install --cask rectangle
brew install --cask tunnelblick

4. You’ll notice, I’ve installed „mas“ – with mas you can connect to the AppStore via CLI – very useful for this case.
>> mas list – lists your current installed apps
>> mas search Remote searches the AppStore for all apps containing „remote“ in it. For the script, you need the IDs of the apps.

mas install 405399194
mas install 1418401222
mas install 1484348796
mas install 747648890
mas install 1333542190
mas install 443987910
mas install 1437501942
mas install 504700302
mas install 1147396723
mas install 824183456
mas install 1295203466
mas install 803453959
mas install 1444383602
mas install 462054704
mas install 462058435
mas install 462062816
mas install 985367838

Now you know my apps being installed 😉

5. I love oh-my-zsh, so its lastly being installed:

if [ ! -d ~/.oh-my-zsh ]; then
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
    rm ~/.zshrc
    ln -s $CURRDIR/zshrc-config ~/.zshrc
fi

6. Create the final file, so we know we did it.

touch ~/.osx-bootstrapped.txt

Final thoughts:

  • The MacBook feels much faster again. And battery consumption went down significantly . Even the error message for the battery went away
  • iCloud sync takes ages: accounts and keychain are still not completely synced, even after 3 hours. The come, tough, bit by bit. But it takes patience.
  • I restarted the MacBook in beginning , holding down „command + r“ and used the disk erase utility to erase the main disk
  • Office 365 didn’t install via mas – I had to do that manually.
  • put the final bash file somewhere into the cloud like dropbox, so that you can download and start it after you’ve erased your MacBook

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.