MAC SETUP SCRIPTS

This is the documentation on our mac setup scripts. You can use this to learn more about our scripts (so that you can run them or improve them) and to write similar scripts yourself.

GETTING STARTED

If you haven't yet done a basic bash scripting tutorial, you may want to do that before proceeding, but you may also be able to understand all of this without much experience . . . this could even be a good way to get started scripting, because the setup scripts are extremely simple logically and syntactically. The only difficulties you'll face setting them up will involve finding the individual settings you can change and executing all of your commands in the right order. But the setup script is really just a series of very simple single-line commands.

HOMEBREW AND CORE ELEMENTS

The first thing we need to do is to get Homebrew installed. The easiest thing to do is

There are bunch of directions you can take from here, Once homebrew is installed, you need a couple of initial apps to get started:

  brew install git
  brew install node
  brew cask install atom

With git, node and atom installed, you are all set to clone this repository with git, install its dependencies with node (well, npm to be precise, and you won't really need this for macsetup, but you will for everything else--so go ahead and do it), and tweak any and all scripts to your liking with atom. Here is an example of the commands you might enter next

  mkdir Development
  cd Development
  git clone https://github.com/mkuzmick/the-tools.git
  cd the-tools
  npm install
  atom .
  # then tweak 01a_manual_start.sh or 02_mainbrew.sh
  ./02_mainbrew.sh
  ./03_preferences.sh
  ./04_fonts.sh
  ./05_atom.sh
  ./06_npm.sh

Again, you'll want to tweak all of those scripts before running them. And to learn how to do this, we'll provide basic explanations of each of these script bundles below.

MAINBREW

Homebrew is a package manager for the Mac. It is very hard--maybe impossible--to live without if you are going to be coding on your Mac, or even if you just need to spend some time in your Mac's Terminal using command line tools. It is so so so much easier installing these tools with Homebrew than it is to go in search of each and every package you need. Here's the bare minimum you're going to need:

brew install git
brew install node
brew cask install atom
brew install awscli
brew install ffmpeg
brew install youtube-dl
brew cask install google-chrome

We also tend to add

brew cask install firefox
brew cask install vlc
brew cask install nvalt
brew cask install blender
brew cask install unity-hub
brew cask install spotify
brew cask install mas

PREFERENCES

You can change many (not absolutely all, but many) preferences and settings from the command line, and this means that you can add these preferences to your macsetup script.

To get started, open up terminal and type defaults read. You will be overwhelmed by how much output you see, but if you scroll through it, you should see loads and loads of "key" = value pairs that have the names of familiar (and unfamiliar) settings. These preferences can also be seen in the many many .plist files you can find in ~/Library/Preferences. To see just ONE value or one cluster of values, you can try commands like these:

defaults read com.apple.Safari
defaults read com.apple.finder ShowStatusBar
defaults read com.apple.screencapture location

In a great piece on setting preferences from the command line, Pawel Gryzybek recommends the following workflow:

  1. log current prefs with defaults read > before
  2. change something
  3. log new prefs with defaults read > after
  4. figure out what's different with diff before after
  5. use that info to construct the new command you need to add to your script

You'll end up finding something like

 "com.apple.menuextra.battery" = {
   ShowPercent = YES;
 };

And this would mean that the command you want to add to your setup scripts is

defaults write com.apple.menuextra.battery ShowPercent -bool YES

And that's basically it. You'll want to make sure that you add a comment that helps the future you understand what this line does, like

# show battery percentage in task bar
defaults write com.apple.menuextra.battery ShowPercent -bool YES

And then you can always comment things out if you don't think you'll use them all the time:

# show battery percentage in task bar
# defaults write com.apple.menuextra.battery ShowPercent -bool YES

There are additional complications that we'll address here eventually:

For more info you are invited to check out these links:

FONTS

Coming soon.

ATOM

Coming soon.

NPM

Coming soon.

EXTRAS

Coming soon.

.............................................

APPENDIX

Extras of all sorts.

THINGS TO ADD

If you would like to help us build these scripts, here are the things we need next. Go ahead and submit a pull request, or just slack MK your new command if you find a way to accomplish what you need to accomplish with a terminal command.

20191126 TODO

20191126 NOTES

FUTURE GOALS