Skip to content

Instantly share code, notes, and snippets.

@yadomi
Last active July 6, 2020 12:03
Show Gist options
  • Save yadomi/70d406b516dd46a84225 to your computer and use it in GitHub Desktop.
Save yadomi/70d406b516dd46a84225 to your computer and use it in GitHub Desktop.
Automate the OSX setup process (eg: you got a new Mac)
#!/bin/sh
echo "\nHello, I will make your Mac awesome"
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
echo "-------------------------"
echo "| Binaries |"
echo "-------------------------"
binaries=(git zsh coreutils findutils)
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
echo "Update brew recipes..."
brew update
for i in "${binaries[@]}"
do
echo "Installing $i"
brew install $i
done
echo "Tyding up homebrew..."
brew cleanup
echo "-------------------------"
echo "| OSX Defaults |"
echo "-------------------------"
echo "Expanding the save panel by default"
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
echo "Saving to disk (not to iCloud) by default"
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
echo "Showing status bar in Finder by default"
defaults write com.apple.finder ShowStatusBar -bool true
echo "Use column view in all Finder windows by default"
defaults write com.apple.finder FXPreferredViewStyle Clmv
echo "Avoiding the creation of .DS_Store files on network volumes"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
echo "Allowing text selection in Quick Look/Preview in Finder by default"
defaults write com.apple.finder QLEnableTextSelection -bool true
echo "No more transparency !"
defaults write com.apple.universalaccess reduceTransparency -bool true
echo "Show hidden files by default"
defaults write com.apple.finder AppleShowAllFiles -bool true
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
echo "Remove warning when changing file extension"
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
echo "Enable super-fast key-repeat"
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10
echo "Done !"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment