#!/usr/bin/env bash # Ask for the administrator password upfront sudo -v # Keep-alive: update existing `sudo` time stamp until the script has finished while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & install_thoughtbot() { log_folder="$HOME/installer/logs" mkdir -p $log_folder && cd "$HOME/installer" # Don't check if this file exists, download it each time curl https://raw.githubusercontent.com/thoughtbot/laptop/master/mac > mac sh mac 2>&1 | tee $log_folder/thoughtbot.log # Install basic dotfiles if [ -d "$HOME/.dotfiles" ]; then cd "$HOME/.dotfiles" git pull cd "$HOME/.dotfiles-local" git pull else git clone git://github.com/thoughtbot/dotfiles.git "$HOME/.dotfiles" git clone https://github.com/execat/dotfiles-local.git "$HOME/.dotfiles-local" fi env RCRC=$HOME/.dotfiles/rcrc rcup rcup # Install 3 finger drag defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -bool true defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerDrag -bool true # Disable hot corners defaults write com.apple.dock wvous-tr-corner -int 0 defaults write com.apple.dock wvous-tl-corner -int 0 } install_brew() { # Install Java for aircrack and other software # brew cask install java brew cask install java brew bundle --file=- < ~/.bin/amm && chmod a+x ~/.bin/amm' # Expo and related NPM packages # npm install expo-cli --global } run_script() { # End script before killing all applications curl https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos | \ sed -e 's/# Kill affected applications/exit/g' | \ sed -e 's/AppleLanguages -array "en" "nl"/AppleLanguages -array "en" "cn" "mr"/g' | \ sed -e 's/AppleLocale -string "en_GB@currency=EUR"/AppleLocale -string "en_US@currency=USD"/g' | \ sed -e 's/Europe\/Brussels/Asia\/Singapore/g' | \ grep -v 'com.apple.notificationcenterui.plist' | \ grep -v 'Solarized Dark xterm-256color' | \ grep -v 'com.apple.dock wvous' | \ grep -v 'open "${HOME}/init/Solarized Dark.itermcolors' | \ grep -v 'com.irradiatedsoftware.SizeUp' | \ grep -v 'Spectacle' | \ grep -v 'com.twitter' | \ grep -v 'com.tapbots.TweetbotMac' | \ bash cat <> ~/.zshrc < tap with 3 fingers * Secondary click -> Click or tap with 2 fingers * Tap to click -> Tap with one finger Also move click to "light" and turn on silent clicking. Also do these things manually: 1. Activate unlimited scrollback for iTerm, set to 'reuse previous dir', change font to Inconsolata-dz Pt 14, in Profile -> Terminal -> Silence bell 2. Go to Finder -> Cmd + up arrow 2 times -> Drag your home folder to left sidebar 3. Click on battery on top right and click on "Show Percentage", click on input method -> open keyboard preferences -> set caps lock to change input method 4. Login to your Firefox account and start bookmark/addon sync 5. Login to your accounts in Netease Music Player/Xiami 6. Put Flux on autostart 7. Login to Dropbox, Skype, Telegram 8. Make VLC default player for famous formats 9. Copy over important VPN configs for Tunnelblick and database configs for Sequel Pro 10. Set up Kodi as per the reddit thread 11. Set up .ssh keys (copy or create new) 12. You might want to log in to these websites: Google account | Twitter | Amazon | GitHub | GitLab | reddit 13. Start jdiskreport and run mlocate 14. Set up keyboards for your preferred languages and layouts 15. Put sensible defaults for Menumeters * Display CPU Menu Meter -> Percentage, Display percentage as: User and System * Disk -> No * Memory -> Used/Free Totals * Network -> Arrows and Throughput 16. Install Xcode from App Store and execute these two commands: * sudo xcode-select -s /Applications/Xcode.app * sudo xcodebuild -license And run Xcode (you might have to install additional components) 17. Run Android Studio so that it can download shizzle for you (~1GB of stuff but takes a while) 18. Execute 'defaults write com.apple.dock persistent-apps -array' to remove all the dock items (if installing for the first time) 19. Disable notifications on Firefox: about:config > dom.webnotifications.enabled > set to false 20. sudo spctl --master-disable to allow all installations from packages, install wireless: https://community.tp-link.com/en/home/stories/detail/1642 21. Iterm preferences -> Keys -> Keybindings -> Change Ctrl + Tab and Ctrl + Shift + Tab to "Next tab" and "Previous tab" Finally, close this tab and all the previously opened terminal tabs and continue working in a new tab. END } install_thoughtbot install_brew install_brew_cask install_binaries run_script install_ohmyzsh install_spacevim install_emacs show_final_messages