dotfiles
My dotfiles for macOS. You could get some of this setup to work on Linux, but you’d have to disable the installation of Homebrew casks, and Mac App Store apps. The setup scripts also include some macOS-only conveniences, like adding Homebrew to PATH on Apple Silicon Macs.
I learned about dotfiles from dotfiles.eieio.xyz. The repo for that course is at https://github.com/eieioxyz/dotfiles_macos.
Decommission Computer
Commit and push to remote repos
brew bundle dump
You might have installed apps on your Mac that aren’t yet reflected in your dotfiles repo. Run brew bundle dump
and compare the resulting file with the Brewfile
in your repo. You can also override the Brewfile
and diff
it. There might be apps you don’t want on your new Mac, so make sure you remove those from the Brewfile
.
Pomodoro
- Back up the
~/Library/Application Support/Pomodoro
directory, which holds an SQL log of all past pomodoros. Pomodoro Stats > Log
, Export as text file, for good measure.- Back up global and local stats keys from
com.ugolandini.Pomodoro
into this repo withdefaults read com.ugolandini.Pomodoro > ~/.dotfiles/pomodoro-defaults-dump.txt
. Then, update thedefaults write com.ugolandini.Pomodoro ...
statements insetup_macos.zsh
with the updated data. 🚨 This is the one non-idempotent part of this repo, so you’ll have to comment out these statements after the initial install on a new machine to avoid resetting your Pomodoro stats.
Visual Studio Code
Make sure Settings Sync is turned on, and that you’re syncing all of the following:
- Settings
- Keyboard Shortcuts for each platform
- User Snippets
- Extensions
- UI State
Deactivate devices and licenses
- Kindle for Mac > Preferences > General > Deregister
- Unregister Boom 3D
Restore Instructions
xcode-select --install
. Running this will prompt the installation of the command line developer tools. Command Line Tools are required for Git and Homebrew. This might take about 15 minutes.- If you’re on an ARM macOS (for example, M1):
softwareupdate --install-rosetta
. This will let you use apps built for a Mac with an Intel processor. git clone https://github.com/andyjakubowski/dotfiles.git ~/.dotfiles
. We'll start withhttps
but switch tossh
after everything is installed.cd ~/.dotfiles
- This repo only has the
main
branch. Some people split their dotfiles repos into separate branching depending on things like the operating system. In that case,git checkout <another_branch>
. - Do one last Software Audit by editing Brewfile directly.
- Sign into the Mac App Store.
./install
- Comment out the
defaults write com.ugolandini.Pomodoro ...
statements that reset Pomodoro stats. You only want to do that part once. - Restart computer.
- Setup up Dropbox (use multifactor authentication!) and allow files to sync before setting up dependent applications. Dependent apps: Alfred, Dash, Pomodoro, Notational Velocity, Boostnote.
- Generate ssh key, add to GitHub, and switch remotes.
# Generate SSH key in default location (~/.ssh/config)
ssh-keygen -t ed25519 -C "477212+andyjakubowski@users.noreply.github.com"
# Start the ssh-agent
eval "$(ssh-agent -s)"
# Create config file with necessary settings
<< EOF > ~/.ssh/config
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519
EOF
# Add private key to ssh-agent
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
# Copy public key to your clipboard
pbcopy < ~/.ssh/id_ed25519.pub
# Add public key to github.com > Settings > SSH and GPG keys > New SSH key
# Test SSH connection, then verify fingerprint and username
# https://help.github.com/en/github/authenticating-to-github/testing-your-ssh-connection
ssh -T git@github.com
# Verify the fingerprint you see matches one of these: https://docs.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints
# Switch from HTTPS to SSH
git remote set-url origin git@github.com:andyjakubowski/dotfiles.git
Things you have to do manually
Safari
- Safari > Debug > Tab Ordering > Position of New Tabs > After Last Tab
- Enable the password manager extension
Remap Caps Lock to Escape
System Preferences > Keyboard > Modifier Keys...
Karabiner Elements
Give the app the permissions it asks for, so you can start using the external keyboard.
Password manager
- Log in.
- Enable the Safari extension.
Dropbox
- Log in.
- Wait until all files have synced.
Visual Studio Code
- Turn on Settings Sync, and wait for it to finish
- Activate Wallaby license
- Activate Quokka license
Sound and Bluetooth
Because setting these via defaults
doesn’t seem to work in Big Sur, you need to do it manually. Or, look into GUI manipulation with AppleScript; that will of course be prone to error if Apple changes the UI of those preference panes.
System Preferences > Sound > Sound Effects > Play sound on startup
: uncheck.System Preferences > Sound > Sound Effects > Show Sound menu bar
: check, set to always.System Preferences > Bluetooth > Show Bluetooth in menu bar
check.
Potential AppleScript automation:
- https://macscripter.net/viewtopic.php?id=46820
- https://latenightsw.com/big-sur/
- https://apple.stackexchange.com/questions/422165/applescript-system-preferences-automation
- https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html
Things
Things Preferences > Things Cloud
, log in.
Divvy
Divvy Preferences > Start Divvy at login
, check.
Pomodoro
- Copy
~/Library/CloudStorage/Dropbox/Pomodoro/Pomodoro.app
to/Applications
. - Copy the contents of
~/Library/CloudStorage/Dropbox/Pomodoro/Log
to~/Library/Application Support/Pomodoro
.
Remember the new pomodoro keyboard shortcut: Control-Option-Command-UpArrow
.
Alfred
https://www.alfredapp.com/help/getting-started/migration/
System Preferences > Keyboard > Shortcuts > Spotlight > Show Spotlight search (cmd+space)
uncheck.Alfred Preferences > Powerpack
add License.Alfred Preferences > General > Request Permissions
.Alfred Preferences > General > Alfred Hotkey
change tocmd+space
.Alfred Preferences > Advanced > Set preferences folder
and set to~/Library/CloudStorage/Dropbox/Alfred
.
Dash
Dash Preferences > Purchase
add license from~/Library/CloudStorage/Dropbox/Dash
.Dash Preferences > General > Set up syncing...
and set to~/Library/CloudStorage/Dropbox/Dash
.
Notational Velocity
Notational Velocity Preferences > Notes > Read notes from folder...
, set to~/Library/CloudStorage/Dropbox/Notational Velocity
.- Automatically setting bookmarks using
defaults
doesn’t seem to work — you’ll need to do it manually.
Boostnote
Boostnote Preferences > Storage
, click Unlink next to the default storage location.Boostnote Preferences > Storage
, click Add Storage Location, set to~/Library/CloudStorage/Dropbox/Boostnote
.
Login items
System Preferences > Users & Groups > Login Items
, make sure the list contains the following:- Divvy
- Pomodoro
- Alfred 4
- Dropbox
Resolving issues
Aliases
When you run ./install
, files like zshenv
and zshrc
will be linked before any software is installed. This means your Z Shell will start using certain aliases that are configured in those files. For example: alias ls='exa -laFh --git'
.
These aliases rely on non-standard software being installed. But if this for whatever reason the software fails to install when you run ./install
, You’ll end up with errors in your terminal like zsh: command not found: exa
.
Run where ls
to see the full path to the original, non-aliased ls
. Then you’d run something like /bin/ls /bin
instead.
Apple Silicon
If you’re setting up a new Mac that uses Apple’s CPUs like the M1, you may need to install Rosetta to run software built for Intel Macs.
Comments
- The
Brewfile
in this repo installs Sketch 74. Update theBrewfile
if you need the latest version.
Todo
- set up Network Link Conditioner
- automate font installation
- Fix issue with
nano
on macOS Monterey where nanorc uses/usr/local/share/nano
, but this path doesn’t seem to exist. - Add config for Safari “Show Develop menu in menu bar”
- Alfred > Calculator > Use decimal point as decimal separator instead of comma