Guest User

Untitled

a guest
Jan 22nd, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.79 KB | None | 0 0
  1. #!/bin/sh
  2. # default commands for osx to make it nicer to work with
  3.  
  4. ##########################
  5. # General UI?UX settings #
  6. ##########################
  7.  
  8. # Set hostname (hex of MVB9APPS)
  9. sudo scutil --set ComputerName "0x4d56423941505053"
  10. sudo scutil --set HostName "0x4d56423941505053"
  11. sudo scutil --set LocalHostName "0x4d56423941505053"
  12. sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "0x4d56423941505053"
  13.  
  14. # Disable the sound effects on boot
  15. #sudo nvram SystemAudioVolume=" "
  16.  
  17. # Disable transparency in the menu bar and elsewhere
  18. defaults write com.apple.universalaccess reduceTransparency -bool true
  19.  
  20. # Increase window resize speed for Cocoa applications
  21. defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
  22.  
  23. # Expand save panel by default
  24. defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
  25. defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
  26.  
  27. # Expand print panel by default
  28. defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
  29. defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
  30.  
  31. # Save to disk (not to iCloud) by default
  32. defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
  33.  
  34. # Automatically quit printer app once the print jobs complete
  35. defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
  36.  
  37. # Remove duplicates in the “Open With” menu (also see `lscleanup` alias)
  38. /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
  39.  
  40. # Reveal IP address, hostname, OS version, etc. when clicking the clock
  41. # in the login window
  42. sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
  43.  
  44. # Check for software updates daily, not just once per week
  45. defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
  46.  
  47. # Disable smart quotes as they’re annoying when typing code
  48. defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
  49.  
  50. # Disable smart dashes as they’re annoying when typing code
  51. defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
  52.  
  53. # Disable opening and closing window animations
  54. defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
  55.  
  56. # Disable Resume system-wide
  57. defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false
  58.  
  59. # Enable subpixel font rendering on non-Apple LCDs
  60. defaults write NSGlobalDomain AppleFontSmoothing -int 2
  61.  
  62. # Disable auto-correct
  63. defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
  64.  
  65. ##############
  66. # SSD tweaks #
  67. ##############
  68.  
  69. # Disable local Time Machine snapshots
  70. sudo tmutil disablelocal
  71.  
  72. # Disable hibernation (speeds up entering sleep mode)
  73. sudo pmset -a hibernatemode 0
  74.  
  75. # Remove the sleep image file to save disk space
  76. sudo rm -f /private/var/vm/sleepimage
  77. # Create a zero-byte file instead…
  78. sudo touch /private/var/vm/sleepimage
  79. # …and make sure it can’t be rewritten
  80. sudo chflags uchg /private/var/vm/sleepimage
  81.  
  82. ###############################################################
  83. # Trackpad, mouse, keyboard, Bluetooth accessories, and input #
  84. ###############################################################
  85.  
  86. # Disable “natural” (Lion-style) scrolling
  87. defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
  88.  
  89. # Enable tap-clicking
  90. sudo defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
  91. sudo defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
  92. sudo defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
  93.  
  94. # Disable "shake to find mouse"
  95. defaults write ~/Library/Preferences/.GlobalPreferences CGDisableCursorLocationMagnification -bool YES
  96.  
  97. # Increase sound quality for Bluetooth headphones/headsets
  98. defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
  99.  
  100. # Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
  101. defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
  102.  
  103. # Disable press-and-hold for keys in favor of key repeat
  104. defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
  105.  
  106. # set key repeat to FAST
  107. defaults write -g InitialKeyRepeat -int 20
  108. defaults write -g KeyRepeat -int 1
  109.  
  110. ##########
  111. # Screen #
  112. ##########
  113.  
  114. # Require password immediately after sleep or screen saver begins
  115. defaults write com.apple.screensaver askForPassword -int 1
  116. defaults write com.apple.screensaver askForPasswordDelay -int 0
  117.  
  118. # Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
  119. defaults write com.apple.screencapture type -string "png"
  120.  
  121. # Disable shadow in screenshots
  122. defaults write com.apple.screencapture disable-shadow -bool true
  123.  
  124. # Enable subpixel font rendering on non-Apple LCDs
  125. defaults write NSGlobalDomain AppleFontSmoothing -int 2
  126.  
  127. # Enable HiDPI display modes (requires restart)
  128. sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
  129.  
  130. ##########
  131. # Finder #
  132. ##########
  133.  
  134. # Finder: disable window animations and Get Info animations
  135. defaults write com.apple.finder DisableAllAnimations -bool true
  136.  
  137. # Set Desktop as the default location for new Finder windows
  138. # For other paths, use `PfLo` and `file:///full/path/here/`
  139. defaults write com.apple.finder NewWindowTarget -string "PfDe"
  140. defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Desktop/"
  141.  
  142. # Show icons for hard drives, servers, and removable media on the desktop
  143. defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
  144. defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
  145. defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
  146. defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
  147.  
  148. # Show item info below desktop icons
  149. /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
  150.  
  151. # Enable snap-to-grid for desktop icons
  152. /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy kind" ~/Library/Preferences/com.apple.finder.plist
  153.  
  154. # Finder: show hidden files by default
  155. defaults write com.apple.finder AppleShowAllFiles -bool true
  156.  
  157. # Finder: show all filename extensions
  158. defaults write NSGlobalDomain AppleShowAllExtensions -bool true
  159.  
  160. # Finder: show status bar
  161. defaults write com.apple.finder ShowStatusBar -bool true
  162.  
  163. # Finder: show path bar
  164. defaults write com.apple.finder ShowPathbar -bool true
  165.  
  166. # Finder: allow text selection in Quick Look
  167. defaults write com.apple.finder QLEnableTextSelection -bool true
  168.  
  169. # Display full POSIX path as Finder window title
  170. defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
  171.  
  172. # When performing a search, search the current folder by default
  173. defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
  174.  
  175. # Disable the warning when changing a file extension
  176. defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
  177.  
  178. # Enable spring loading for directories
  179. defaults write NSGlobalDomain com.apple.springing.enabled -bool true
  180.  
  181. # Tweak the spring loading delay for directories
  182. defaults write NSGlobalDomain com.apple.springing.delay -float .5
  183.  
  184. # Avoid creating .DS_Store files on network volumes
  185. defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
  186.  
  187. # Disable the warning before emptying the Trash
  188. defaults write com.apple.finder WarnOnEmptyTrash -bool false
  189.  
  190. # Empty Trash securely by default
  191. defaults write com.apple.finder EmptyTrashSecurely -bool true
  192.  
  193. # Enable AirDrop over Ethernet and on unsupported Macs running Lion
  194. defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
  195.  
  196. # Enable the MacBook Air SuperDrive on any Mac
  197. sudo nvram boot-args="mbasd=1"
  198.  
  199. # Show the ~/Library folder
  200. chflags nohidden ~/Library
  201.  
  202. # Expand the following File Info panes:
  203. # “General”, “Open with”, and “Sharing & Permissions”
  204. defaults write com.apple.finder FXInfoPanesExpanded -dict \
  205. General -bool true \
  206. OpenWith -bool true \
  207. Privileges -bool true
  208.  
  209. ####################################
  210. # Dock, Dashboard, and hot corners #
  211. ####################################
  212.  
  213. # Enable highlight hover effect for the grid view of a stack (Dock)
  214. defaults write com.apple.dock mouse-over-hilite-stack -bool true
  215.  
  216. # Set the icon size of Dock items to 36 pixels
  217. defaults write com.apple.dock tilesize -int 36
  218.  
  219. # Change minimize/maximize window effect
  220. defaults write com.apple.dock mineffect -string "scale"
  221.  
  222. # Minimize windows into their application’s icon
  223. defaults write com.apple.dock minimize-to-application -bool true
  224.  
  225. # Enable spring loading for all Dock items
  226. defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
  227.  
  228. # Show indicator lights for open applications in the Dock
  229. defaults write com.apple.dock show-process-indicators -bool true
  230.  
  231. # Wipe all (default) app icons from the Dock
  232. # This is only really useful when setting up a new Mac, or if you don’t use
  233. # the Dock to launch apps.
  234. defaults write com.apple.dock persistent-apps -array
  235.  
  236. # Don’t animate opening applications from the Dock
  237. defaults write com.apple.dock launchanim -bool false
  238.  
  239. # Speed up Mission Control animations
  240. defaults write com.apple.dock expose-animation-duration -float 0.1
  241.  
  242. # Don’t group windows by application in Mission Control
  243. # (i.e. use the old Exposé behavior instead)
  244. defaults write com.apple.dock expose-group-by-app -bool false
  245.  
  246. # Disable Dashboard
  247. #defaults write com.apple.dashboard mcx-disabled -bool true
  248.  
  249. # Don’t show Dashboard as a Space
  250. defaults write com.apple.dock dashboard-in-overlay -bool true
  251.  
  252. # Don’t automatically rearrange Spaces based on most recent use
  253. defaults write com.apple.dock mru-spaces -bool false
  254.  
  255. # Remove the auto-hiding Dock delay
  256. defaults write com.apple.dock autohide-delay -float 0
  257. # Remove the animation when hiding/showing the Dock
  258. defaults write com.apple.dock autohide-time-modifier -float 0
  259.  
  260. # Automatically hide and show the Dock
  261. defaults write com.apple.dock autohide -bool true
  262.  
  263. # Make Dock icons of hidden applications translucent
  264. defaults write com.apple.dock showhidden -bool true
  265.  
  266. # Disable the Launchpad gesture (pinch with thumb and three fingers)
  267. defaults write com.apple.dock showLaunchpadGestureEnabled -int 0
  268.  
  269. # Reset Launchpad, but keep the desktop wallpaper intact
  270. find "${HOME}/Library/Application Support/Dock" -name "*-*.db" -maxdepth 1 -delete
  271.  
  272. # Add a spacer to the left side of the Dock (where the applications are)
  273. defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
  274. # Add a spacer to the right side of the Dock (where the Trash is)
  275. defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'
  276.  
  277. # Hot corners
  278. # Possible values:
  279. # 0: no-op
  280. # 2: Mission Control
  281. # 3: Show application windows
  282. # 4: Desktop
  283. # 5: Start screen saver
  284. # 6: Disable screen saver
  285. # 7: Dashboard
  286. # 10: Put display to sleep
  287. # 11: Launchpad
  288. # 12: Notification Center
  289. # Top left screen corner → Mission Control
  290. defaults write com.apple.dock wvous-tl-corner -int 2
  291. defaults write com.apple.dock wvous-tl-modifier -int 0
  292. # Top right screen corner → Start screen saver
  293. defaults write com.apple.dock wvous-tr-corner -int 5
  294. defaults write com.apple.dock wvous-tr-modifier -int 0
  295. # Bottom left screen corner → Desktop
  296. defaults write com.apple.dock wvous-bl-corner -int 4
  297. defaults write com.apple.dock wvous-bl-modifier -int 0
  298.  
  299. ###################
  300. # Safari & webkit #
  301. ###################
  302.  
  303. # Privacy: don’t send search queries to Apple
  304. defaults write com.apple.Safari UniversalSearchEnabled -bool false
  305. defaults write com.apple.Safari SuppressSearchSuggestions -bool true
  306.  
  307. # Press Tab to highlight each item on a web page
  308. defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true
  309. defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true
  310.  
  311. # Show the full URL in the address bar (note: this still hides the scheme)
  312. defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
  313.  
  314. # Set Safari’s home page to `about:blank` for faster loading
  315. defaults write com.apple.Safari HomePage -string "about:blank"
  316.  
  317. # Prevent Safari from opening ‘safe’ files automatically after downloading
  318. defaults write com.apple.Safari AutoOpenSafeDownloads -bool false
  319.  
  320. # Enable Safari’s debug menu
  321. defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
  322.  
  323. # Make Safari’s search banners default to Contains instead of Starts With
  324. defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
  325.  
  326. # Remove useless icons from Safari’s bookmarks bar
  327. defaults write com.apple.Safari ProxiesInBookmarksBar "()"
  328.  
  329. # Enable the Develop menu and the Web Inspector in Safari
  330. defaults write com.apple.Safari IncludeDevelopMenu -bool true
  331. defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
  332. defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
  333.  
  334. # Add a context menu item for showing the Web Inspector in web views
  335. defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
  336.  
  337. # Disable Safari’s thumbnail cache for History and Top Sites
  338. defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
  339.  
  340. #############
  341. # Spotlight #
  342. #############
  343.  
  344. # Hide Spotlight tray-icon (and subsequent helper)
  345. #sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
  346.  
  347. # Disable Spotlight indexing for any volume that gets mounted and has not yet
  348. # been indexed before.
  349. # Use `sudo mdutil -i off "/Volumes/foo"` to stop indexing any volume.
  350. sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"
  351.  
  352. # Change indexing order and disable some search results
  353. # Yosemite-specific search results (remove them if your are using OS X 10.9 or older):
  354. # MENU_DEFINITION
  355. # MENU_CONVERSION
  356. # MENU_EXPRESSION
  357. # MENU_SPOTLIGHT_SUGGESTIONS (send search queries to Apple)
  358. # MENU_WEBSEARCH (send search queries to Apple)
  359. # MENU_OTHER
  360. defaults write com.apple.spotlight orderedItems -array \
  361. '{"enabled" = 1;"name" = "APPLICATIONS";}' \
  362. '{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \
  363. '{"enabled" = 1;"name" = "DIRECTORIES";}' \
  364. '{"enabled" = 1;"name" = "PDF";}' \
  365. '{"enabled" = 1;"name" = "FONTS";}' \
  366. '{"enabled" = 1;"name" = "DOCUMENTS";}' \
  367. '{"enabled" = 1;"name" = "MESSAGES";}' \
  368. '{"enabled" = 1;"name" = "CONTACT";}' \
  369. '{"enabled" = 0;"name" = "EVENT_TODO";}' \
  370. '{"enabled" = 1;"name" = "IMAGES";}' \
  371. '{"enabled" = 0;"name" = "BOOKMARKS";}' \
  372. '{"enabled" = 0;"name" = "MUSIC";}' \
  373. '{"enabled" = 0;"name" = "MOVIES";}' \
  374. '{"enabled" = 0;"name" = "PRESENTATIONS";}' \
  375. '{"enabled" = 0;"name" = "SPREADSHEETS";}' \
  376. '{"enabled" = 0;"name" = "SOURCE";}' \
  377. '{"enabled" = 0;"name" = "MENU_DEFINITION";}' \
  378. '{"enabled" = 0;"name" = "MENU_OTHER";}' \
  379. '{"enabled" = 0;"name" = "MENU_CONVERSION";}' \
  380. '{"enabled" = 0;"name" = "MENU_EXPRESSION";}' \
  381. '{"enabled" = 0;"name" = "MENU_WEBSEARCH";}' \
  382. '{"enabled" = 0;"name" = "MENU_SPOTLIGHT_SUGGESTIONS";}'
  383. # Load new settings before rebuilding the index
  384. killall mds > /dev/null 2>&1
  385.  
  386. # Make sure indexing is enabled for the main volume
  387. sudo mdutil -i on / > /dev/null
  388.  
  389. # Rebuild the index from scratch
  390. sudo mdutil -E / > /dev/null
  391.  
  392. ################
  393. # Time Machine #
  394. ################
  395.  
  396. # Prevent Time Machine from prompting to use new hard drives as backup volume
  397. defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
  398.  
  399. # Disable local Time Machine backups
  400. hash tmutil > /dev/null && sudo tmutil disablelocal
  401.  
  402. #######################
  403. # Terminal and iterm2 #
  404. #######################
  405.  
  406. # Only use UTF-8 in Terminal.app
  407. defaults write com.apple.terminal StringEncodings -array 4
  408.  
  409. # Don’t display the annoying prompt when quitting iTerm
  410. defaults write com.googlecode.iterm2 PromptOnQuit -bool false
  411.  
  412. ####################
  413. # Activity Monitor #
  414. ####################
  415.  
  416. # Show the main window when launching Activity Monitor
  417. defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
  418.  
  419. # Visualize CPU usage in the Activity Monitor Dock icon
  420. defaults write com.apple.ActivityMonitor IconType -int 5
  421.  
  422. # Show all processes in Activity Monitor
  423. defaults write com.apple.ActivityMonitor ShowCategory -int 0
  424.  
  425. # Sort Activity Monitor results by CPU usage
  426. defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
  427. defaults write com.apple.ActivityMonitor SortDirection -int 0
  428.  
  429. #############################################################
  430. # Address Book, Dashboard, iCal, TextEdit, and Disk Utility #
  431. #############################################################
  432.  
  433. # Enable the debug menu in Address Book
  434. defaults write com.apple.addressbook ABShowDebugMenu -bool true
  435.  
  436. # Enable Dashboard dev mode (allows keeping widgets on the desktop)
  437. defaults write com.apple.dashboard devmode -bool true
  438.  
  439. # Enable the debug menu in iCal (pre-10.8)
  440. defaults write com.apple.iCal IncludeDebugMenu -bool true
  441.  
  442. # Use plain text mode for new TextEdit documents
  443. defaults write com.apple.TextEdit RichText -int 0
  444.  
  445. # Open and save files as UTF-8 in TextEdit
  446. defaults write com.apple.TextEdit PlainTextEncoding -int 4
  447. defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
  448.  
  449. # Set tab width to 4 instead of the default 8
  450. defaults write com.apple.TextEdit "TabWidth" '4'
  451.  
  452. # Enable the debug menu in Disk Utility
  453. defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
  454. defaults write com.apple.DiskUtility advanced-image-options -bool true
  455.  
  456. #################
  457. # Mac app store #
  458. #################
  459.  
  460. # Enable the WebKit Developer Tools in the Mac App Store
  461. defaults write com.apple.appstore WebKitDeveloperExtras -bool true
  462.  
  463. # Enable Debug Menu in the Mac App Store
  464. defaults write com.apple.appstore ShowDebugMenu -bool true
  465.  
  466. ################
  467. # Messages.app #
  468. ################
  469.  
  470. # Disable smart quotes as it’s annoying for messages that contain code
  471. defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
  472.  
  473. # Disable continuous spell checking
  474. defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481. ###############################################################################
  482. # Kill affected applications #
  483. ###############################################################################
  484. for app in "Activity Monitor" "Address Book" "Calendar" "Contacts" "cfprefsd" \
  485. "Dock" "Finder" "Google Chrome" "Google Chrome Canary" "Mail" "Messages" \
  486. "Opera" "Safari" "SizeUp" "Spectacle" "SystemUIServer" \
  487. "Transmission" "Twitter" "iCal"; do
  488. killall "${app}" > /dev/null 2>&1
  489. done
  490.  
  491. echo "Done. Note that some of these changes require a logout/restart of your OS to take effect. At a minimum, be sure to restart your Terminal."
Add Comment
Please, Sign In to add comment