/
setup.osx.sh
78 lines (56 loc) · 3.56 KB
/
setup.osx.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
# OS X configuration
# Lots more at:
# https://github.com/paulirish/dotfiles/blob/master/.osx
fancy_echo "Mac OS X configuration ..."
###############################################################################
# Finder, Dock #
###############################################################################
# Show the ~/Library folder
chflags nohidden ~/Library
# Enable snap-to-grid for icons in all icon views and dialogs
/usr/libexec/PlistBuddy -c "Set :ComputerViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
# Add iOS Simulator to Launchpad
sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app" "/Applications/iOS Simulator.app"
###############################################################################
# Trackpad, mouse, keyboard, Bluetooth accessories, and input #
###############################################################################
# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Disable press-and-hold for keys in favor of key repeat
#defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Faster key repeat
#defaults write NSGlobalDomain InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
#defaults write NSGlobalDomain KeyRepeat -int 1 # normal minimum is 2 (30 ms)
###############################################################################
# Screen #
###############################################################################
# Save screenshots to the desktop
#defaults write com.apple.screencapture location -string "${HOME}/Desktop"
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture type -string "png"
# Disable shadow in screenshots
#defaults write com.apple.screencapture disable-shadow -bool true
###############################################################################
# Apps #
###############################################################################
# Safari enable developer menu
defaults write com.apple.Safari IncludeDebugMenu 1
###############################################################################
# Kill affected applications #
###############################################################################
# I had issues with Finder locking up so just do manual logout/restart
#for app in "Activity Monitor" "Address Book" "Calendar" "Contacts" "cfprefsd" \
# "Dock" "Finder" "Google Chrome" "Google Chrome Canary" "Mail" "Messages" \
# "Opera" "Safari" "SizeUp" "Spectacle" "SystemUIServer" "Terminal" \
# "Transmission" "Twitter" "iCal"; do
# killall "${app}" > /dev/null 2>&1
#done
fancy_echo "Mac OS X configuration complete."
fancy_echo "Note that some of these changes require a logout/restart to take effect."