#!/usr/bin/env bash cd "$(dirname "$0")" source ../helpers if [[ "$OS" != macos ]]; then echo '!!! This script is only available for macOS' exit 1 fi if ! type brew &>/dev/null; then echo '--- Installing Homebrew' /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" if ! type brew &>/dev/null; then echo '!!! Failed to install Homebrew' exit 1 fi fi brew analytics off install_deps # https://eclecticlight.co/2019/08/15/global-defaults-in-macos-mojave/ echo '--- Setting OS X preferences' chflags nohidden ~/Library defaults write -g ApplePressAndHoldEnabled -bool false defaults write -g KeyRepeat -int 0 defaults write -g InitialKeyRepeat -int 0 defaults write -g NSAutomaticCapitalizationEnabled -bool false defaults write -g NSAutomaticDashSubstitutionEnabled -bool false defaults write -g NSAutomaticPeriodSubstitutionEnabled -bool false defaults write -g NSAutomaticQuoteSubstitutionEnabled -bool false defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false defaults write -g NSAutomaticTextCompletionEnabled -bool false defaults write -g NSDocumentSaveNewDocumentsToCloud -bool false defaults write -g WebAutomaticSpellingCorrectionEnabled -bool false defaults write -g WebKitDeveloperExtras -bool true defaults write -g com.apple.sound.beep.flash -bool false defaults write -g com.apple.swipescrolldirection -bool false defaults write com.apple.Finder FXPreferredViewStyle Nlsv defaults write com.apple.screencapture disable-shadow true defaults write com.apple.Safari ShowFavoritesBar -bool false defaults write com.apple.Safari IncludeInternalDebugMenu -bool true 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 defaults write com.googlecode.iterm2 LoadPrefsFromCustomFolder -bool true defaults write com.googlecode.iterm2 PrefsCustomFolder -string "$HOME/.config/iterm" if [[ ! -e "$HOME/iCloud" ]]; then echo '--- Adding symlink to iCloud' ln -s "$HOME/Library/Mobile Documents/com~apple~CloudDocs" "$HOME/iCloud" fi