Skip to content

Instantly share code, notes, and snippets.

@NSURLSession0
Last active December 22, 2020 20:17
Show Gist options
  • Save NSURLSession0/03416dd4bacf61ab7a290515c8a2db74 to your computer and use it in GitHub Desktop.
Save NSURLSession0/03416dd4bacf61ab7a290515c8a2db74 to your computer and use it in GitHub Desktop.
#
# Mac Setup
# 2020-12-22
#
# Install Xcode Command Line Tools
echo "Installing Xcode Command Line Tools..."
xcode-select --install
# Install Homebrew if we don't have it
if test ! $(which brew); then
echo "Installing Homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Update homebrew recipes
echo "Updating Homebrew..."
brew update
# Install brew packages
echo "Installing Homebrew packages..."
brew_packages = (
fastlane
swiftformat
)
brew install ${brew_packages[@]}
# Install apps with brew cask
echo "Installing apps with Homebrew cask..."
cask_apps = (
adguard
alfred
boop
cleanmymac
filezilla
#font-source-code-pro
#font-source-code-pro-for-powerline
#font-source-sans-pro
#font-source-serif-pro
google-chrome
imageoptim
klokki
koala
mas
macdown
mamp
malwarebytes
microsoft-teams
namechanger
numi
onepassword
openinterminal-lite
opensim
paw
provisionql
qlcolorcode
qlmarkdown
quicklook-json
screens
screens-connect
slack
skype
sourcetree
spotify
sublime-text
surfshark
suspicious-package
swiftformat-for-xcode
tableplus
the-unarchiver
visual-paradigm
visual-studio
vlc
whatsapp
)
brew install --cask ${cask_apps[@]}
# Cleanup Homebrew
brew cleanup
# Install apps from the Mac App Store
echo "Installing Mac AppStore Apps..."
mas_apps = (
409201541 # Apple Pages
409203825 # Apple Numbers
967805235 # Paste - Clipboard Manager
472226235 # LanScan
417375580 # BetterSnapTool (paid app)
897118787 # Shazam
1445434819 # Receiver Radio (paid app)
1357379892 # Menu Bar Controller for Sonos (paid app)
)
mas install ${mas_apps[@]}
echo "Setting some Mac settings..."
# Allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool TRUE
# Expanding the save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Automatically quit printer app once the print jobs complete
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
# Enabling full keyboard access for all controls (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Disabling press-and-hold for keys in favor of a key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Setting trackpad & mouse speed to a reasonable number
defaults write -g com.apple.trackpad.scaling 2
defaults write -g com.apple.mouse.scaling 2.5
# Enabling subpixel font rendering on non-Apple LCDs
defaults write NSGlobalDomain AppleFontSmoothing -int 2
# Showing all filename extensions in Finder by default
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Disabling the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Avoiding the creation of .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Speeding up Mission Control animations and grouping windows by application
#defaults write com.apple.dock expose-animation-duration -float 0.1
#defaults write com.apple.dock "expose-group-by-app" -bool true
# Setting Dock to auto-hide and removing the auto-hiding delay
defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
# Setting email addresses to copy as '[email protected]' instead of 'Foo Bar <[email protected]>' in Mail.app
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
# Enabling UTF-8 ONLY in Terminal.app and setting the Pro theme by default
#defaults write com.apple.terminal StringEncodings -array 4
#defaults write com.apple.Terminal "Default Window Settings" -string "Pro"
#defaults write com.apple.Terminal "Startup Window Settings" -string "Pro"
# Preventing Time Machine from prompting to use new hard drives as backup volume
#defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
# Disable the sudden motion sensor as its not useful for SSDs
#sudo pmset -a sms 0
# Disable annoying backswipe in Chrome
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
# Enabling Safari's debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# Making Safari's search banners default to Contains instead of Starts With
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
# Allow hitting the Backspace key to go to the previous page in history
#defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true
# Enabling the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool true
# Adding a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
# Don’t automatically rearrange Spaces based on most recent use
defaults write com.apple.dock mru-spaces -bool false
killall Finder
killall Dock
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment