osx 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. #!/bin/bash
  2. # ~/.osx — http://mths.be/osx
  3. # Ask for the administrator password upfront
  4. sudo -v
  5. # Keep-alive: update existing `sudo` time stamp until `.osx` has finished
  6. while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
  7. ###############################################################################
  8. # General UI/UX #
  9. ###############################################################################
  10. # Set computer name (as done via System Preferences → Sharing)
  11. sudo scutil --set ComputerName "Fleetwood iMac"
  12. sudo scutil --set HostName "Fleetwood iMac"
  13. sudo scutil --set LocalHostName "Fleetwood iMac"
  14. sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "Fleetwood iMac"
  15. # Set standby delay to 24 hours (default is 1 hour)
  16. sudo pmset -a standbydelay 86400
  17. # Disable the sound effects on boot
  18. sudo nvram SystemAudioVolume=" "
  19. # Disable transparency in the menu bar and elsewhere on Yosemite
  20. defaults write com.apple.universalaccess reduceTransparency -bool true
  21. #r: hide the Time Machine, Volume, and User icons
  22. for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do
  23. defaults write "${domain}" dontAutoLoad -array \
  24. "/System/Library/CoreServices/Menu Extras/TimeMachine.menu" \
  25. "/System/Library/CoreServices/Menu Extras/Volume.menu" \
  26. "/System/Library/CoreServices/Menu Extras/User.menu"
  27. done
  28. defaults write com.apple.systemuiserver menuExtras -array \
  29. "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" \
  30. "/System/Library/CoreServices/Menu Extras/AirPort.menu" \
  31. "/System/Library/CoreServices/Menu Extras/Battery.menu" \
  32. "/System/Library/CoreServices/Menu Extras/Clock.menu"
  33. # Set highlight color to green
  34. defaults write NSGlobalDomain AppleHighlightColor -string "0.764700 0.976500 0.568600"
  35. # Set sidebar icon size to medium
  36. defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2
  37. # Always show scrollbars
  38. defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
  39. # Possible values: `WhenScrolling`, `Automatic` and `Always`
  40. # Disable smooth scrolling
  41. # (Uncomment if you’re on an older Mac that messes up the animation)
  42. #defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false
  43. # Increase window resize speed for Cocoa applications
  44. defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
  45. # Expand save panel by default
  46. defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
  47. defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
  48. # Expand print panel by default
  49. defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
  50. defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
  51. # Save to disk (not to iCloud) by default
  52. defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
  53. # Automatically quit printer app once the print jobs complete
  54. defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
  55. # Disable the “Are you sure you want to open this application?” dialog
  56. defaults write com.apple.LaunchServices LSQuarantine -bool false
  57. # Remove duplicates in the “Open With” menu (also see `lscleanup` alias)
  58. /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
  59. # Display ASCII control characters using caret notation in standard text views
  60. # Try e.g. `cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt`
  61. defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
  62. # Disable Resume system-wide
  63. defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false
  64. # Disable automatic termination of inactive apps
  65. defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
  66. # Disable the crash reporter
  67. #defaults write com.apple.CrashReporter DialogType -string "none"
  68. # Set Help Viewer windows to non-floating mode
  69. defaults write com.apple.helpviewer DevMode -bool true
  70. # Fix for the ancient UTF-8 bug in QuickLook (https://mths.be/bbo)
  71. # Commented out, as this is known to cause problems in various Adobe apps :(
  72. # See https://github.com/mathiasbynens/dotfiles/issues/237
  73. #echo "0x08000100:0" > ~/.CFUserTextEncoding
  74. # Reveal IP address, hostname, OS version, etc. when clicking the clock
  75. # in the login window
  76. sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
  77. # Restart automatically if the computer freezes
  78. sudo systemsetup -setrestartfreeze on
  79. # Never go into computer sleep mode
  80. sudo systemsetup -setcomputersleep Off > /dev/null
  81. # Check for software updates daily, not just once per week
  82. defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
  83. # Disable Notification Center and remove the menu bar icon
  84. launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 2> /dev/null
  85. # Disable smart quotes as they’re annoying when typing code
  86. defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
  87. # Disable smart dashes as they’re annoying when typing code
  88. defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
  89. # Set a custom wallpaper image. `DefaultDesktop.jpg` is already a symlink, and
  90. # all wallpapers are in `/Library/Desktop Pictures/`. The default is `Wave.jpg`.
  91. #rm -rf ~/Library/Application Support/Dock/desktoppicture.db
  92. #sudo rm -rf /System/Library/CoreServices/DefaultDesktop.jpg
  93. #sudo ln -s /path/to/your/image /System/Library/CoreServices/DefaultDesktop.jpg
  94. ###############################################################################
  95. # Trackpad, mouse, keyboard, Bluetooth accessories, and input #
  96. ###############################################################################
  97. # Trackpad: enable tap to click for this user and for the login screen
  98. defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
  99. defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
  100. defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
  101. # Trackpad: map bottom right corner to right-click
  102. defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
  103. defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true
  104. defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1
  105. defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true
  106. # Disable “natural” (Lion-style) scrolling
  107. defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
  108. # Increase sound quality for Bluetooth headphones/headsets
  109. defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
  110. # Enable full keyboard access for all controls
  111. # (e.g. enable Tab in modal dialogs)
  112. defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
  113. # Use scroll gesture with the Ctrl (^) modifier key to zoom
  114. defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
  115. defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
  116. # Follow the keyboard focus while zoomed in
  117. defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
  118. # Disable press-and-hold for keys in favor of key repeat
  119. defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
  120. # Set a blazingly fast keyboard repeat rate
  121. defaults write NSGlobalDomain KeyRepeat -int 0
  122. # Set language and text formats
  123. # Note: if you’re in the US, replace `EUR` with `USD`, `Centimeters` with
  124. # `Inches`, `en_GB` with `en_US`, and `true` with `false`.
  125. defaults write NSGlobalDomain AppleLanguages -array "en" "nl"
  126. defaults write NSGlobalDomain AppleLocale -string "en_GB@currency=EUR"
  127. defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters"
  128. defaults write NSGlobalDomain AppleMetricUnits -bool true
  129. # Set the timezone; see `sudo systemsetup -listtimezones` for other values
  130. sudo systemsetup -settimezone "Europe/Brussels" > /dev/null
  131. # Disable auto-correct
  132. defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
  133. # Stop iTunes from responding to the keyboard media keys
  134. #launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist 2> /dev/null
  135. ###############################################################################
  136. # Screen #
  137. ###############################################################################
  138. # Require password immediately after sleep or screen saver begins
  139. defaults write com.apple.screensaver askForPassword -int 1
  140. defaults write com.apple.screensaver askForPasswordDelay -int 0
  141. # Save screenshots to the desktop
  142. defaults write com.apple.screencapture location -string "${HOME}/Desktop"
  143. # Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
  144. defaults write com.apple.screencapture type -string "png"
  145. # Disable shadow in screenshots
  146. defaults write com.apple.screencapture disable-shadow -bool true
  147. # Enable subpixel font rendering on non-Apple LCDs
  148. defaults write NSGlobalDomain AppleFontSmoothing -int 2
  149. # Enable HiDPI display modes (requires restart)
  150. sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
  151. ###############################################################################
  152. # Finder #
  153. ###############################################################################
  154. # Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons
  155. defaults write com.apple.finder QuitMenuItem -bool true
  156. # Finder: disable window animations and Get Info animations
  157. defaults write com.apple.finder DisableAllAnimations -bool true
  158. # Set Desktop as the default location for new Finder windows
  159. # For other paths, use `PfLo` and `file:///full/path/here/`
  160. defaults write com.apple.finder NewWindowTarget -string "PfDe"
  161. defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Desktop/"
  162. # Show icons for hard drives, servers, and removable media on the desktop
  163. defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
  164. defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
  165. defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
  166. defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
  167. # Finder: show hidden files by default
  168. #defaults write com.apple.finder AppleShowAllFiles -bool true
  169. # Finder: show all filename extensions
  170. defaults write NSGlobalDomain AppleShowAllExtensions -bool true
  171. # Finder: show status bar
  172. defaults write com.apple.finder ShowStatusBar -bool true
  173. # Finder: show path bar
  174. defaults write com.apple.finder ShowPathbar -bool true
  175. # Finder: allow text selection in Quick Look
  176. defaults write com.apple.finder QLEnableTextSelection -bool true
  177. # Display full POSIX path as Finder window title
  178. defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
  179. # When performing a search, search the current folder by default
  180. defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
  181. # Disable the warning when changing a file extension
  182. defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
  183. # Enable spring loading for directories
  184. defaults write NSGlobalDomain com.apple.springing.enabled -bool true
  185. # Remove the spring loading delay for directories
  186. defaults write NSGlobalDomain com.apple.springing.delay -float 0
  187. # Avoid creating .DS_Store files on network volumes
  188. defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
  189. # Disable disk image verification
  190. defaults write com.apple.frameworks.diskimages skip-verify -bool true
  191. defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
  192. defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
  193. # Automatically open a new Finder window when a volume is mounted
  194. defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
  195. defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
  196. defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
  197. # Show item info near icons on the desktop and in other icon views
  198. /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
  199. /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
  200. /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
  201. # Show item info to the right of the icons on the desktop
  202. /usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist
  203. # Enable snap-to-grid for icons on the desktop and in other icon views
  204. /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
  205. /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
  206. /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
  207. # Increase grid spacing for icons on the desktop and in other icon views
  208. /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
  209. /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
  210. /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
  211. # Increase the size of icons on the desktop and in other icon views
  212. /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
  213. /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
  214. /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
  215. # Use list view in all Finder windows by default
  216. # Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
  217. defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
  218. # Disable the warning before emptying the Trash
  219. defaults write com.apple.finder WarnOnEmptyTrash -bool false
  220. # Empty Trash securely by default
  221. defaults write com.apple.finder EmptyTrashSecurely -bool true
  222. # Enable AirDrop over Ethernet and on unsupported Macs running Lion
  223. defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
  224. # Enable the MacBook Air SuperDrive on any Mac
  225. sudo nvram boot-args="mbasd=1"
  226. # Show the ~/Library folder
  227. chflags nohidden ~/Library
  228. # Remove Dropbox’s green checkmark icons in Finder
  229. file=/Applications/Dropbox.app/Contents/Resources/emblem-dropbox-uptodate.icns
  230. [ -e "${file}" ] && mv -f "${file}" "${file}.bak"
  231. # Expand the following File Info panes:
  232. # “General”, “Open with”, and “Sharing & Permissions”
  233. defaults write com.apple.finder FXInfoPanesExpanded -dict \
  234. General -bool true \
  235. OpenWith -bool true \
  236. Privileges -bool true
  237. ###############################################################################
  238. # Dock, Dashboard, and hot corners #
  239. ###############################################################################
  240. # Enable highlight hover effect for the grid view of a stack (Dock)
  241. defaults write com.apple.dock mouse-over-hilite-stack -bool true
  242. # Set the icon size of Dock items to 36 pixels
  243. defaults write com.apple.dock tilesize -int 36
  244. # Change minimize/maximize window effect
  245. defaults write com.apple.dock mineffect -string "scale"
  246. # Minimize windows into their application’s icon
  247. defaults write com.apple.dock minimize-to-application -bool true
  248. # Enable spring loading for all Dock items
  249. defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
  250. # Show indicator lights for open applications in the Dock
  251. defaults write com.apple.dock show-process-indicators -bool true
  252. # Wipe all (default) app icons from the Dock
  253. # This is only really useful when setting up a new Mac, or if you don’t use
  254. # the Dock to launch apps.
  255. #defaults write com.apple.dock persistent-apps -array
  256. # Don’t animate opening applications from the Dock
  257. defaults write com.apple.dock launchanim -bool false
  258. # Speed up Mission Control animations
  259. defaults write com.apple.dock expose-animation-duration -float 0.1
  260. # Don’t group windows by application in Mission Control
  261. # (i.e. use the old Exposé behavior instead)
  262. defaults write com.apple.dock expose-group-by-app -bool false
  263. # Disable Dashboard
  264. defaults write com.apple.dashboard mcx-disabled -bool true
  265. # Don’t show Dashboard as a Space
  266. defaults write com.apple.dock dashboard-in-overlay -bool true
  267. # Don’t automatically rearrange Spaces based on most recent use
  268. defaults write com.apple.dock mru-spaces -bool false
  269. # Remove the auto-hiding Dock delay
  270. defaults write com.apple.dock autohide-delay -float 0
  271. # Remove the animation when hiding/showing the Dock
  272. defaults write com.apple.dock autohide-time-modifier -float 0
  273. # Automatically hide and show the Dock
  274. defaults write com.apple.dock autohide -bool true
  275. # Make Dock icons of hidden applications translucent
  276. defaults write com.apple.dock showhidden -bool true
  277. # Disable the Launchpad gesture (pinch with thumb and three fingers)
  278. #defaults write com.apple.dock showLaunchpadGestureEnabled -int 0
  279. # Reset Launchpad, but keep the desktop wallpaper intact
  280. find "${HOME}/Library/Application Support/Dock" -name "*-*.db" -maxdepth 1 -delete
  281. # Add iOS Simulator to Launchpad
  282. sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app" "/Applications/iOS Simulator.app"
  283. # Add a spacer to the left side of the Dock (where the applications are)
  284. #defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
  285. # Add a spacer to the right side of the Dock (where the Trash is)
  286. #defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'
  287. # Hot corners
  288. # Possible values:
  289. # 0: no-op
  290. # 2: Mission Control
  291. # 3: Show application windows
  292. # 4: Desktop
  293. # 5: Start screen saver
  294. # 6: Disable screen saver
  295. # 7: Dashboard
  296. # 10: Put display to sleep
  297. # 11: Launchpad
  298. # 12: Notification Center
  299. # Top left screen corner → Mission Control
  300. defaults write com.apple.dock wvous-tl-corner -int 2
  301. defaults write com.apple.dock wvous-tl-modifier -int 0
  302. # Top right screen corner → Desktop
  303. defaults write com.apple.dock wvous-tr-corner -int 4
  304. defaults write com.apple.dock wvous-tr-modifier -int 0
  305. # Bottom left screen corner → Start screen saver
  306. defaults write com.apple.dock wvous-bl-corner -int 5
  307. defaults write com.apple.dock wvous-bl-modifier -int 0
  308. ###############################################################################
  309. # Safari & WebKit #
  310. ###############################################################################
  311. # Privacy: don’t send search queries to Apple
  312. defaults write com.apple.Safari UniversalSearchEnabled -bool false
  313. defaults write com.apple.Safari SuppressSearchSuggestions -bool true
  314. # Press Tab to highlight each item on a web page
  315. defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true
  316. defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true
  317. # Show the full URL in the address bar (note: this still hides the scheme)
  318. defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
  319. # Set Safari’s home page to `about:blank` for faster loading
  320. defaults write com.apple.Safari HomePage -string "about:blank"
  321. # Prevent Safari from opening ‘safe’ files automatically after downloading
  322. defaults write com.apple.Safari AutoOpenSafeDownloads -bool false
  323. # Allow hitting the Backspace key to go to the previous page in history
  324. defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true
  325. # Hide Safari’s bookmarks bar by default
  326. defaults write com.apple.Safari ShowFavoritesBar -bool false
  327. # Hide Safari’s sidebar in Top Sites
  328. defaults write com.apple.Safari ShowSidebarInTopSites -bool false
  329. # Disable Safari’s thumbnail cache for History and Top Sites
  330. defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
  331. # Enable Safari’s debug menu
  332. defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
  333. # Make Safari’s search banners default to Contains instead of Starts With
  334. defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
  335. # Remove useless icons from Safari’s bookmarks bar
  336. defaults write com.apple.Safari ProxiesInBookmarksBar "()"
  337. # Enable the Develop menu and the Web Inspector in Safari
  338. defaults write com.apple.Safari IncludeDevelopMenu -bool true
  339. defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
  340. defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
  341. # Add a context menu item for showing the Web Inspector in web views
  342. defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
  343. ###############################################################################
  344. # Terminal & iTerm 2 #
  345. ###############################################################################
  346. # Only use UTF-8 in Terminal.app
  347. defaults write com.apple.terminal StringEncodings -array 4
  348. # Use a modified version of the Solarized Dark theme by default in Terminal.app
  349. TERM_PROFILE='Solarized Dark xterm-256color';
  350. CURRENT_PROFILE="$(defaults read com.apple.terminal 'Default Window Settings')";
  351. if [ "${CURRENT_PROFILE}" != "${TERM_PROFILE}" ]; then
  352. open "${HOME}/srv/${TERM_PROFILE}.terminal";
  353. sleep 1; # Wait a bit to make sure the theme is loaded
  354. defaults write com.apple.terminal 'Default Window Settings' -string "${TERM_PROFILE}";
  355. defaults write com.apple.terminal 'Startup Window Settings' -string "${TERM_PROFILE}";
  356. fi;
  357. # Enable “focus follows mouse” for Terminal.app and all X11 apps
  358. # i.e. hover over a window and start typing in it without clicking first
  359. defaults write com.apple.terminal FocusFollowsMouse -bool true
  360. defaults write org.x.X11 wm_ffm -bool true
  361. # Install the Solarized Dark theme for iTerm
  362. open "${HOME}/srv/Solarized Dark.itermcolors"
  363. # Don’t display the annoying prompt when quitting iTerm
  364. defaults write com.googlecode.iterm2 PromptOnQuit -bool false
  365. ###############################################################################
  366. # Activity Monitor #
  367. ###############################################################################
  368. # Show the main window when launching Activity Monitor
  369. defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
  370. # Visualize CPU usage in the Activity Monitor Dock icon
  371. defaults write com.apple.ActivityMonitor IconType -int 5
  372. # Show all processes in Activity Monitor
  373. defaults write com.apple.ActivityMonitor ShowCategory -int 0
  374. # Sort Activity Monitor results by CPU usage
  375. defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
  376. defaults write com.apple.ActivityMonitor SortDirection -int 0
  377. ###############################################################################
  378. # Address Book, Dashboard, iCal, TextEdit, and Disk Utility #
  379. ###############################################################################
  380. # Enable the debug menu in Address Book
  381. defaults write com.apple.addressbook ABShowDebugMenu -bool true
  382. # Enable Dashboard dev mode (allows keeping widgets on the desktop)
  383. defaults write com.apple.dashboard devmode -bool true
  384. # Enable the debug menu in iCal (pre-10.8)
  385. defaults write com.apple.iCal IncludeDebugMenu -bool true
  386. # Use plain text mode for new TextEdit documents
  387. defaults write com.apple.TextEdit RichText -int 0
  388. # Open and save files as UTF-8 in TextEdit
  389. defaults write com.apple.TextEdit PlainTextEncoding -int 4
  390. defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
  391. # Enable the debug menu in Disk Utility
  392. defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
  393. defaults write com.apple.DiskUtility advanced-image-options -bool true
  394. ###############################################################################
  395. # Mac App Store #
  396. ###############################################################################
  397. # Enable the WebKit Developer Tools in the Mac App Store
  398. defaults write com.apple.appstore WebKitDeveloperExtras -bool true
  399. # Enable Debug Menu in the Mac App Store
  400. defaults write com.apple.appstore ShowDebugMenu -bool true
  401. ###############################################################################
  402. # Google Chrome & Google Chrome Canary #
  403. ###############################################################################
  404. # Allow installing user scripts via GitHub Gist or Userscripts.org
  405. defaults write com.google.Chrome ExtensionInstallSources -array "https://gist.githubusercontent.com/" "http://userscripts.org/*"
  406. defaults write com.google.Chrome.canary ExtensionInstallSources -array "https://gist.githubusercontent.com/" "http://userscripts.org/*"
  407. # Disable the all too sensitive backswipe
  408. defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
  409. defaults write com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls -bool false
  410. # Use the system-native print preview dialog
  411. defaults write com.google.Chrome DisablePrintPreview -bool true
  412. defaults write com.google.Chrome.canary DisablePrintPreview -bool true
  413. ###############################################################################
  414. # GPGMail 2 #
  415. ###############################################################################
  416. # Disable signing emails by default
  417. defaults write ~/Library/Preferences/org.gpgtools.gpgmail SignNewEmailsByDefault -bool false
  418. ###############################################################################
  419. # Kill affected applications #
  420. ###############################################################################
  421. for app in "Activity Monitor" "Address Book" "Calendar" "Contacts" "cfprefsd" \
  422. "Dock" "Finder" "Mail" "Messages" "Safari" "SizeUp" "SystemUIServer" \
  423. "Terminal" "Transmission" "Twitter" "iCal"; do
  424. killall "${app}" > /dev/null 2>&1
  425. done
  426. echo "Done. Note that some of these changes require a logout/restart to take effect."