With every new Macbook, I'm updating the guide, previous version is here.
Things didn't change too much from the previous version. The main difference is that because new Macbooks use Apple Silicon and that causes endless issues, it's pretty much mandatory to install Docker.
Basics
- Go to Settings > Privacy & Security > FileVault, turn on FileVault. Do not use iCloud for recovery, just note your recovery key somewhere. This used to require computer restart, but it just works now.
- Install some sensible browser like Chrome or Firefox.
- Afterwards either sign up into your account on which you hopefully have your ad blocker setup, or install some. Most popular seems to be uBlock Origin these days, but pretty much any of them will do just fine.
- Install iTerm2 for sensible terminal emulator. If you start it, it will also prompt you to install XCode Command Line Tools, which you'll definitely need, so do it now.
- Install whichever cloud sync service you're using like Dropbox etc. And start syncing your stuff.
- Clean up all crap from dock. Other than Launchpad and System Settings, everything else should be gone. Add iTerm2, your browser, and your text editor, and any application you wish to install there instead of stock Apple crap.
Editor
Install some sensible text editor. These days most people use Visual Studio Code. If you do, go to Options, search "Telemetry" and disable it all.If that's your choice, run it, open Command Palette, and choose: "Shell Command: Install 'code' command in PATH".
Settings
Like every other operating system, OSX has a lot of bad default settings. Here are some obvious fixes:- If you have multiple monitor setup, go to Settings > Display > Arrangement and drag and drop them into correct arrangement so mouse can move between them correctly. To make Spaces work correctly, you'll also need to set your external monitor to be the main one by drag and dropping menu bar to it.
- You might need to do it twice - with laptop screen open, and with laptop screen closed.
- Also set up which will be your main monitor by dragging that white bar on top of the display icon to it. This looks like Menu placement, but it really mostly controls Dock placement.
- Settings > Appearance > Dark. If you're setting up a new laptop, this will be asked during installation.
- Settings > Keyboard > Key Repeat > Fast (max is correct)
- Settings > Keyboard > Delay Until Repeat > Short (max is correct)
- Settings > Keyboard > Disable keyboard brightness completely. Defaults (slow keyboard, highlight keys) are meant for people who are bad at typing. If this somehow applies to you, get some typing lessons, you can save huge amount of time by getting better at typing.
- Settings > Trackpad > Scroll & Zoom > Disable "Natural scrolling". This will also apply to the mouse, restoring correct direction.
- Settings > Sound > Disable "Play sound on startup"
- Settings > Sound > Disable "Play user interface sound effects"
- Settings > Sound > Alert volume > 0% (for Terminal ping)
- Settings > Desktop & Dock > enable "Automatically hide and show the Dock"
- Settings > Desktop & Dock > disable "Automatically rearrange Spaces based on most recent use"
- Settings > Displays > Max out brightness
- Settings > Displays > Turn off "Automatically adjust brightness"
- Settings > Displays > Turn off "True Tone"
- Settings > Control Center > Battery > Enable "Show Percentage"
- Settings > Control Center > Clock > Clock Options > Use a 24-hour clock. This might be already on based on your regional choices during installation.
- Settings > Mouse > increase scrolling speed and tracking speed a bit
- Settings > Lock Screen > Start Screen Saver when inactive > Never. You should generally be doing it yourself, and you often need to leave the laptop running upgrades or unit tests or such, and you want to be able to see the status without constantly poking it.
- Settings > Lock Screen > Require password after screen saver begins or display is turned off > After 5 minutes. You can move it down to 1 minute if you use your laptop in public. I don't recommend Immediately, as that causes endless annoyance with connecting and disconnecting external monitors and just moving laptop around requiring new password.
- Settings > Sharing > Remote Login > Turn on
- Settings > Sharing > Remote Login > (i icon) > All Users
- Settings > Sharing > Remote Login > (i icon) > Allow full disk access for remote users
- iTerm > Preferences... > Profiles > Terminal > Unlimited Scrollback
- disable "Show Floating Thumbnail"
- Save to > Other Location... choose "Downloads" folder
Drivers
OSX already includes drivers for laptop itself, but you might need some for peripheral hardware.In particular, external PC keyboard need a tweak to work properly, as left and left Windows keys are in reverse order from Mac keyboard.
Go to Settings, Keyboard, Modifier Keys..., choose the right keyboard from the dropdown (strangely I had ordinary wireless mouse selected by default), and swap positions of Option and Command keys. Feel free to change functionality of Caps Lock key as well, it's a huge easily accessible key with no useful function people love to remap, usually to extra Control.
If you need any special keyboard layouts, get them too.
Development tools
You'll need Xcode. Fortunately iTerm does it for you automatically, and if not homebrew will. If you need to do it manually for some reason, you can install Xcode manually by running xcode-select --install from command line.
Deal with stupid access popups
Create new SSH key pair
Before you do that, name your computer something memorable with sudo scutil --set HostName your_host_name command. You probably go through a lot of laptops, so names like "Name's Macbook" are completely useless to you. Just pick a theme like cats or dinosaurs or whatnot, and give every computer a distinct namOpen Terminal and run ssh-keygen to create ~/.ssh/id_rsa, then upload the generated key to any place that needs to know about it like github, bitbucket, or whatever else you use.
Checkout your dotfiles
Hopefully you're storing your dotfiles somewhere. If it's a git repository, or your Dropbox account, get them now and symlink them all properly.If there are any other repositories you might need, checkout them too.
Standard paths
OSX renames a lot of directories. The most annoying of those is that instead of/home
it has /Users
. It used to be very easy to add a symlink, but this kept getting more and more complicated, so I stopped doing this.Install homebrew packages
Your list might vary. Here's a few obvious suggestions:brew install rbenv ruby-build mc wget p7zip trash git htop bash zsh youtube-dl jq imagemagick coreutils bash-completion zsh-completion nodeenv
Then enable all services you installed, unless you want to start them manually:
ln -sfv /usr/local/opt/*/*.plist ~/Library/LaunchAgents/
And install non-system ruby, so you can install gems without sudo. Currently latest is:
rbenv install 3.1.3
rbenv global 3.1.3
To make that actually work, you need to make sure ~/.rbenv/shims is in your $PATH. If you type
rbenv init
, it will tell you what to do.Due to OSX limitations you'll need to run sudo htop if you want to use htop.
Install gems
Again, your list my vary. These days most of the software will have its ownGemfile
so long list of gems are generally unnecessary. But some global utilities are still useful:gem install bundler rak pry pry-rescue
Different Shell
OSX switched from ridiculously outdated bash to up to date zsh, so it's no longer a mandatory step.brew install bash
.You'll need to edit /etc/shells as admin and add the following lines at the end of it to enable your newly installed shell:
/usr/local/bin/bash
/usr/local/bin/zsh
Then set it as your shell, with whichever one you prefer:
chsh -s /usr/local/bin/bash $USER
chsh -s /usr/local/bin/zsh $USER
Hushlogin
Coreutils
This is optional step. OSX coreutils are generally a lot worse than GNU versions you might be used to from Linux. However switching means occasional minor incompatibilities, so it's up to you if you want to do it or not.If you want to do so,
brew install coreutils
, then add GNU coreutils to your PATH:export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"
cp -a
now works), so this step can be skipped.Better window manager controls
Sadly OSX window manager is extremely dubious for keyboard use. Fortunately programs to make it usable exist. Unfortunately there's a lot of churn among those programs, and every couple of years the ones I use become unmaintained and need to be replaced by something else.- Rectangle - for moving windows around on big screens - I don't really like the default keybindings, so I change them to Cmd-Control-Option with 1,2,3,4 for corners, arrows for halves, and M for maximize and get rid of the rest. Also set Repeated commands to "cycle through displays".
- AltTab - for switching between windows - it's baffling that OSX completely lacks this function - and Cmd-Tab to switch between applications is absolutely inadequate for any application that has more than one window, which is most of them (browsers, editors, terminals etc.) if you're developing software.
- Settings > Security & Privacy > Privacy > Allow the apps below to control your computer > enable AltTab and Rectangle
Open files limit
ulimit -n 100000
in your .zshrc, which might be adequate, but not every process runs from the terminal. Lower security settings
sudo spctl --master-disable
Android File Transfer
All other software
brew install homebrew/cask/gitup
).