Advertisement
Guest User

ehhbrew

a guest
Oct 11th, 2018
1,391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.17 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. echo "Starting bootstrapping"
  4.  
  5. # Check for Homebrew, install if we don't have it
  6. if test ! $(which brew); then
  7. echo "Installing homebrew..."
  8. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  9. fi
  10.  
  11. brew update
  12. brew tap homebrew/core
  13.  
  14. brew install coreutils
  15. #brew install gnu-sed --with-default-names
  16. #brew install gnu-tar --with-default-names
  17. #brew install gnu-indent --with-default-names
  18. #brew install gnu-which --with-default-names
  19. #brew install gnu-grep --with-default-names
  20.  
  21. # Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
  22. brew install findutils
  23.  
  24. # Install Bash 4
  25. brew install bash
  26.  
  27. PACKAGES=(
  28. ansible
  29. bash-completion
  30. composer
  31. git
  32. #htop
  33. mc
  34. npm
  35. ssh-copy-id
  36. tree
  37. vim
  38. wget
  39. )
  40.  
  41. echo "Installing packages..."
  42. brew install ${PACKAGES[@]}
  43.  
  44. echo "Cleaning up..."
  45. brew cleanup
  46.  
  47. echo "Installing cask..."
  48. brew install homebrew-cask
  49.  
  50. CASKS=(
  51. appcleaner
  52. google-chrome
  53. google-backup-and-sync
  54. iterm2
  55. phpstorm
  56. postman
  57. sequel-pro
  58. skype
  59. spotify
  60. tableplus
  61. teamviewer
  62. tunnelblick
  63. vlc
  64. )
  65.  
  66. echo "Installing cask apps..."
  67. brew cask install ${CASKS[@]}
  68.  
  69. echo "Installing fonts..."
  70. brew tap caskroom/fonts
  71. FONTS=(
  72. font-hack-nerd-font
  73. font-roboto
  74. font-source-sans-pro
  75. )
  76. brew cask install ${FONTS[@]}
  77.  
  78. echo "Configuring OSX..."
  79.  
  80. # Show the ~/Library folder
  81. chflags nohidden ~/Library
  82.  
  83. # Show the /Volumes folder
  84. sudo chflags nohidden /Volumes
  85.  
  86. # Disable the “Are you sure you want to open this application?” dialog
  87. defaults write com.apple.LaunchServices LSQuarantine -bool false
  88.  
  89. # Show language menu in the top right corner of the boot screen
  90. sudo defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool true
  91.  
  92. # Save screenshots to Google Drive
  93. defaults write com.apple.screencapture location -string "${HOME}/Google Drive/ScreenShots"
  94.  
  95. # Disable shadow in screenshots
  96. defaults write com.apple.screencapture disable-shadow -bool true
  97.  
  98. # Avoid creating .DS_Store files on network or USB volumes
  99. defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
  100. defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
  101.  
  102. # Disable Dashboard
  103. defaults write com.apple.dashboard mcx-disabled -bool true
  104.  
  105. # Use plain text mode for new TextEdit documents
  106. defaults write com.apple.TextEdit RichText -int 0
  107.  
  108. # Open and save files as UTF-8 in TextEdit
  109. defaults write com.apple.TextEdit PlainTextEncoding -int 4
  110. defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
  111.  
  112. # Enable the debug menu in Disk Utility
  113. defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
  114. defaults write com.apple.DiskUtility advanced-image-options -bool true
  115.  
  116. # Disable continuous spell checking
  117. defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false
  118.  
  119. ####################################
  120. # NSGlobalDomain #
  121. ####################################
  122.  
  123. # Enable tap-to-click
  124. defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
  125. defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
  126.  
  127. # Show filename extensions by default
  128. defaults write NSGlobalDomain AppleShowAllExtensions -bool true
  129.  
  130. # Set fast key repeat rate
  131. defaults write NSGlobalDomain KeyRepeat -int 0
  132. defaults write NSGlobalDomain InitialKeyRepeat -int 15
  133.  
  134. defaults write NSGlobalDomain com.apple.keyboard.fnState -int 1
  135.  
  136. # Set sidebar icon size to small
  137. # Possible values: 1 small, 2 medium, 3 large
  138. defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 1
  139.  
  140. # WhenScrolling show scrollbars
  141. # Possible values: `WhenScrolling`, `Automatic` and `Always`
  142. defaults write NSGlobalDomain AppleShowScrollBars -string "WhenScrolling"
  143.  
  144. defaults write NSGlobalDomain AppleWindowTabbingMode -string "always"
  145.  
  146. defaults write NSGlobalDomain AppleActionOnDoubleClick -string "Maximize"
  147.  
  148. defaults write NSGlobalDomain AppleAquaColorVariant -int 1
  149.  
  150. defaults write NSGlobalDomain AppleMiniaturizeOnDoubleClick -bool false
  151.  
  152. ####################################
  153. # Finder #
  154. ####################################
  155.  
  156. defaults write com.apple.finder ShowStatusBar -bool true
  157. defaults write com.apple.finder ShowPathbar -bool true
  158. defaults write com.apple.finder ShowSidebar -bool true
  159. defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
  160. defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
  161. defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
  162. defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
  163. defaults write com.apple.finder ShowRecentTags -bool false
  164.  
  165. # Use list view in all Finder windows by default
  166. # Possible values: `icnv`, `clmv`, `Flwv` `Nlsv`
  167. defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
  168. defaults write com.apple.finder FXPreferredGroupBy -string "None"
  169.  
  170.  
  171. defaults write com.apple.finder FXICloudDriveEnabled -bool true
  172. defaults write com.apple.finder FXICloudDriveDesktop -bool true
  173. defaults write com.apple.finder FXICloudDriveDocuments -bool true
  174.  
  175. defaults write com.apple.finder FinderSpawnTab -bool true
  176.  
  177. defaults write com.apple.finder FXArrangeGroupViewBy -string "Name"
  178.  
  179. defaults write com.apple.finder NewWindowTarget -string "PfHm"
  180. defaults write com.apple.finder NewWindowTargetPath -string "file:///Users/szirom/"
  181.  
  182. defaults write com.apple.finder SidebarDevicesSectionDisclosedState -bool true
  183. defaults write com.apple.finder SidebarPlacesSectionDisclosedState -bool true
  184. defaults write com.apple.finder SidebarShowingSignedIntoiCloud -bool true
  185. defaults write com.apple.finder SidebarShowingiCloudDesktop -bool true
  186. defaults write com.apple.finder SidebarTagsSctionDisclosedState -bool true
  187. defaults write com.apple.finder SidebariCloudDriveSectionDisclosedState -bool true
  188. defaults write com.apple.finder SidebarWidth -int 124
  189.  
  190. ####################################
  191. # Dock #
  192. ####################################
  193.  
  194. # Set the icon size of Dock items (30px)
  195. defaults write com.apple.dock tilesize -int 30
  196.  
  197. defaults write com.apple.dock largesize -int 70
  198.  
  199. defaults write com.apple.dock magnification -bool true
  200.  
  201. # Don't minimize windows into their applications icon
  202. defaults write com.apple.dock minimize-to-application -bool false
  203.  
  204. # Show indicator lights for open applications in the Dock
  205. defaults write com.apple.dock show-process-indicators -bool true
  206.  
  207. # Animate opening applications from the Dock
  208. defaults write com.apple.dock launchanim -bool true
  209.  
  210. # Speed up Mission Control animations
  211. defaults write com.apple.dock expose-animation-duration -float 0.1
  212.  
  213. # Don’t group windows by application in Mission Control
  214. # (i.e. use the old Exposé behavior instead)
  215. defaults write com.apple.dock expose-group-by-app -bool false
  216.  
  217. # Don’t show Dashboard as a Space
  218. defaults write com.apple.dock dashboard-in-overlay -bool true
  219.  
  220. # Remove the auto-hiding Dock delay
  221. defaults write com.apple.dock autohide-delay -float 0
  222.  
  223. # Remove the animation when hiding/showing the Dock
  224. defaults write com.apple.dock autohide-time-modifier -float 0
  225.  
  226. # Automatically hide and show the Dock
  227. defaults write com.apple.dock autohide -bool true
  228.  
  229. # Hot corners
  230. # Possible values:
  231. # 0: no-op
  232. # 2: Mission Control
  233. # 3: Show application windows
  234. # 4: Desktop
  235. # 5: Start screen saver
  236. # 6: Disable screen saver
  237. # 7: Dashboard
  238. # 10: Put display to sleep
  239. # 11: Launchpad
  240. # 12: Notification Center
  241. #
  242. # Top left screen corner
  243. defaults write com.apple.dock wvous-tl-corner -int 0
  244. defaults write com.apple.dock wvous-tl-modifier -int 0
  245. # Top right screen corner
  246. defaults write com.apple.dock wvous-tr-corner -int 0
  247. defaults write com.apple.dock wvous-tr-modifier -int 0
  248. # Bottom left screen corner
  249. defaults write com.apple.dock wvous-bl-corner -int 0
  250. defaults write com.apple.dock wvous-bl-modifier -int 0
  251. # Bottom right screen corner
  252. defaults write com.apple.dock wvous-bl-corner -int 2
  253. defaults write com.apple.dock wvous-bl-modifier -int 0
  254.  
  255. # Change indexing order and disable some search results
  256. # Yosemite-specific search results (remove them if you are using macOS 10.9 or older):
  257. # MENU_DEFINITION
  258. # MENU_CONVERSION
  259. # MENU_EXPRESSION
  260. # MENU_SPOTLIGHT_SUGGESTIONS (send search queries to Apple)
  261. # MENU_WEBSEARCH (send search queries to Apple)
  262. # MENU_OTHER
  263. defaults write com.apple.spotlight orderedItems -array \
  264. '{"enabled" = 1;"name" = "APPLICATIONS";}' \
  265. '{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \
  266. '{"enabled" = 0;"name" = "DIRECTORIES";}' \
  267. '{"enabled" = 0;"name" = "PDF";}' \
  268. '{"enabled" = 0;"name" = "FONTS";}' \
  269. '{"enabled" = 0;"name" = "DOCUMENTS";}' \
  270. '{"enabled" = 0;"name" = "MESSAGES";}' \
  271. '{"enabled" = 1;"name" = "CONTACT";}' \
  272. '{"enabled" = 1;"name" = "EVENT_TODO";}' \
  273. '{"enabled" = 0;"name" = "IMAGES";}' \
  274. '{"enabled" = 1;"name" = "BOOKMARKS";}' \
  275. '{"enabled" = 0;"name" = "MUSIC";}' \
  276. '{"enabled" = 0;"name" = "MOVIES";}' \
  277. '{"enabled" = 0;"name" = "PRESENTATIONS";}' \
  278. '{"enabled" = 0;"name" = "SPREADSHEETS";}' \
  279. '{"enabled" = 0;"name" = "SOURCE";}' \
  280. '{"enabled" = 1;"name" = "MENU_DEFINITION";}' \
  281. '{"enabled" = 0;"name" = "MENU_OTHER";}' \
  282. '{"enabled" = 1;"name" = "MENU_CONVERSION";}' \
  283. '{"enabled" = 0;"name" = "MENU_EXPRESSION";}' \
  284. '{"enabled" = 0;"name" = "MENU_WEBSEARCH";}' \
  285. '{"enabled" = 0;"name" = "MENU_SPOTLIGHT_SUGGESTIONS";}'
  286. # Load new settings before rebuilding the index
  287. killall mds > /dev/null 2>&1
  288. # Make sure indexing is enabled for the main volume
  289. sudo mdutil -i on / > /dev/null
  290. # Rebuild the index from scratch
  291. sudo mdutil -E / > /dev/null
  292.  
  293. ###############################################################################
  294. # Kill affected applications #
  295. ###############################################################################
  296.  
  297. for app in "Activity Monitor" \
  298. "cfprefsd" \
  299. "Dock" \
  300. "Finder" \
  301. "Google Chrome" \
  302. "Messages" \
  303. "SystemUIServer"; do
  304. killall "${app}" &> /dev/null
  305. done
  306.  
  307. echo "Bootstrapping complete"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement