Skip to content

miclgael/setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽ setup

Opinionated notes and scripts for setting up a fresh macOS computer for web development (Follow at your own risk / benefit)

๐Ÿ’ก I also have guides for Linux and Windows!

NB: Requires macOS 11+ (ideally macOS 12+)

โœจ Automated install

If its your first time here, I'd recommend skipping this automated install and following the steps manually. This will give you a chance to read the instructions and make sure you're happy with everything.

If you just want to run the whole thing in one go, you can use the following command:

๐Ÿšง Are you sure you want to automate this?
Yes, please reveal
bash <(curl -s https://raw.githubusercontent.com/miclgael/setup/main/scripts/main.sh)

Or you can just clone the repo, CD in and run sh scripts/main.sh

Please note, even if you do run the automated install, you'll still need to manually clean-up some steps at the end. So its a good idea to keep this README around.

Steps:

๐Ÿป Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • Installs Xcode command line tools
  • Installs Git!
  • Gives access to the brew command.

Install Git Large File Storage

I like to immediately install this, otherwise I forget and then things go haywire later when I pull down a repo that needs lfs.

brew install git-lfs

๐Ÿ’ค Install zsh and oh-my-zsh

Zsh should be installed first! See installing zsh or use brew:

brew install zsh

(follow the instructions)

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

(follow the instructions, again)

Install plugins

brew install spaceship zsh-autosuggestions zsh-syntax-highlighting

(no need to follow the instructions if using ./dotfiles/modules/sources.sh)

Configure Git Signing (GNUPG)

This can be an awful process but I found this combination of solutions to work well for me.

Full steps here
brew install gnupg pinentry-mac

Quit and reopen your terminal here. Heck, restart your machine.

Create and append pinentry, "allowing the gpg key's passphrase to be stored in the login keychain, enabling automatic key signing". - Wes

mkdir -m 700 -p ~/.gnupg && \
touch ~/.gnupg/gpg-agent.conf && \
echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf &&\
killall gpg-agent

Create a new key that will work locally and also with Github.

gpg --default-new-key-algo rsa4096 --gen-key

Test GPG is working

echo "test" | gpg --clearsign
  • List the keys
  • Copy line #2 to your clipboard
gpg --list-secret-keys --keyid-format=long | grep sec -A 1

Print ASCII version of the key, for Github.

gpg --export --armor YOUR_GPG_KEY_HERE | pbcopy

Then, paste the output into GitHubโ€™s GPG settings page

Finally, tell git about your key

git config --global user.signingkey YOUR_GPG_KEY_HERE
git config --global commit.gpgsign true
git config --global gpg.program gpg

Setup GPG in Sourcetree

ln -s /usr/local/bin/gpg /usr/local/bin/gpg2

In Sourcetree, go to advanced settings and point the gpg file to /usr/local/bin

Troubleshooting

brew unlink gpg && brew link gpg
# Kill gpg-agent
killall gpg-agent

# Run gpg-agent in daemon mode
gpg-agent --daemon

Credit: Wes, John

๐Ÿ‘ฉโ€๐Ÿ’ป Install development software

brew install --cask iterm2 visual-studio-code mamp codekit tableplus tower obsidian insomnia docker fastfetch && \
brew install --cask google-chrome firefox homebrew/cask-versions/firefox-developer-edition && \
brew install composer

Micro editor (nicer than Nano, easier than Vim)

brew install micro

๐Ÿ’ป Install preferred VS Code extensions

There are a few ways to handle this, depending on your flavour of VS Code.

  1. Easy: If you don't care about telemetry, just use the built-in sync functions in VS Code. Note: a Microsoft or Github* account is required
  2. Medium: If you're using VS Codium, you might like to try the Settings Sync extension. Connect to a Github Gist in order to save your settings
  3. Hard: Manually install using the command line, code --install-extension <extension-name>. You could still save your settings to a Github Gist)

* ๐Ÿ‘‹

๐ŸŽจ Install design software

brew install --cask figma nucleo imageoptim

Install Fira Code font

brew tap homebrew/cask-fonts && \
brew install font-fira-code

Install Google Web Fonts

curl https://raw.githubusercontent.com/qrpike/Web-Font-Load/master/install.sh | bash

๐Ÿ›ก๏ธ Install security and backup software

brew install --cask 1password nordvpn carbon-copy-cloner dropbox

๐Ÿ’ฌ Install chat and teamwork software

brew install --cask microsoft-teams onedrive slack discord signal zoom megasync

๐ŸŽน Install music and multimedia software

brew install --cask ableton-live-suite loopback && \
brew install --cask handbrake obs && \
brew install progrium/taps/topframe && \
brew install blackhole-16ch && \
brew install --cask elektron-transfer && \
brew install switchaudio-osx && \
brew install --cask vlc && \
brew install --cask ilok-license-manager

๐Ÿ’š Install Node Version Manager

Installs NVM (switch between multiple versions of Node.JS on the same system)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Installs Node.JS and relative NPM version.

nvm install node # "node" is an alias for the latest version
๐Ÿค– Auto-load from `.nvmrc` when changing directory

This can be skipped if using ./dotfiles/modules/scripts.sh

# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
  local node_version="$(nvm version)"
  local nvmrc_path="$(nvm_find_nvmrc)"

  if [ -n "$nvmrc_path" ]; then
    local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")

    if [ "$nvmrc_node_version" = "N/A" ]; then
      nvm install
    elif [ "$nvmrc_node_version" != "$node_version" ]; then
      nvm use
    fi
  elif [ "$node_version" != "$(nvm version default)" ]; then
    echo "Reverting to nvm default version"
    nvm use default
  fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc

credit :)

Install global node packages

๐Ÿ“œ Install ES Lint

Required for the VS Code extension to work properly on single JS files.

npm install -g eslint

Condenses 4+ package managers worth of commands into a single set.

npm install -g @antfu/ni

๐Ÿ–ฅ๏ธ Install Netlify CLI

npm install -g netlify-cli

netlify login

Referenced in aliases - ./dotfiles/modules/aliases.sh

๐Ÿ“น Set up Netlify Large Media

(requires Git LFS)

cd project-name
netlify link
netlify lm:setup

๐Ÿš€ Install helpful utils

brew install --cask alfred bartender rocket bettertouchtool && \
brew install --cask homebrew/cask-drivers/elgato-control-center && \
brew install speedtest-cli && \
brew install --cask syncthing && \
brew install --cask cleanshot

๐ŸŽฎ Install some distractions (optional)

brew install --cask altserver steam plex && \
brew install --cask homebrew/cask-drivers/sony-ps-remote-play && \
brew install --cask blender lycheeslicer 

Link dotfiles (untested)

@TODO - test this

git clone git@github.com:miclgael/setup.git ~/Code/projects/setup && \
cd ~/Code/projects/setup && \
mv ./dotfiles/.zshrc.example ~/.zshrc

๐Ÿ‘ฉโ€๐Ÿ’ป macOS AppStore exclusive downloads

These are some apps I love, but can't currently aquire via Homebrew

AppStore Link price Note
Amphetamine free Prevent OS from sleeping
Lightweight PDF free Minify PDFs for sharing
Noizio Lite free/paid white noise generator
Notability paid Sync with iPad notes app
Spark Email free a very amazing email experience*
The Unarchiver free Slightly better archiving GUI
Things 3 paid The sexiest to-do app
Tomato 2 free/paid Tidy Pomodoro alarm
Reeder 5 paid I sync Pocket and FreshRSS to this
Xcode free Purely for simulating iOS devices
ColorSlurp free Keep track of branding and colours
Davinci Resolve free Now available in the MAS!

* But do read the privacy policy

See also, mas-cli

brew install mas

Mig's Mas one-linerโ„ข

mas install 937984704 1450640351 1481029536 360593530 1176895641 425424353 904280696 1494210770 1529448980 1287239339 571213070

๐Ÿงผ Clean-up

Add spaces to the dock

defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'

killall Dock

๐Ÿ’ก Tip I usually add 7 gaps to visually separate my apps into the following 8 groups

  • Email, To-do, Calendar, Notes
  • Web browsers
  • Password / Auth
  • Development tools
  • Music apps
  • Design tools
  • Misc.

Credits