-
Notifications
You must be signed in to change notification settings - Fork 2
/
osx-system-defaults.sh
executable file
·41 lines (35 loc) · 1.53 KB
/
osx-system-defaults.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
#!/bin/zsh
echo "\nSet OsX system defaults"
# ==============================================
# Set energy preferences
# ==============================================
IS_LAPTOP=`/usr/sbin/system_profiler SPHardwareDataType | grep "Model Identifier" | grep "Book"`
if [[ "$IS_LAPTOP" != "" ]]; then
pmset -b sleep 20 disksleep 15 displaysleep 10 halfdim 1
pmset -c sleep 0 disksleep 0 displaysleep 30 halfdim 1
# Menu bar: show remaining battery time (on pre-10.8); hide percentage
defaults write com.apple.menuextra.battery ShowPercent -string "YES"
defaults write com.apple.menuextra.battery ShowTime -string "NO"
else
pmset sleep 0 disksleep 0 displaysleep 15 halfdim 1
fi
# ==============================================
# Login window
# ==============================================
# Don't show any password hints
defaults write /Library/Preferences/com.apple.loginwindow RetriesUntilHint -int 0
# ==============================================
# Set keyboard preferences
# ==============================================
# Enable key repeat
defaults write -g ApplePressAndHoldEnabled -bool false
# Set keyboard repeat rate
defaults write -g KeyRepeat -int 2
defaults write -g InitialKeyRepeat -int 15
# ==============================================
# Set Input preferences
# ==============================================
# Disable auto-correct
defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false
# Set scroll direction
defaults write /Library/Preferences/.GlobalPreferences com.apple.swipescrolldirection -bool false