-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmacsetup.sh
More file actions
executable file
·84 lines (67 loc) · 2.46 KB
/
macsetup.sh
File metadata and controls
executable file
·84 lines (67 loc) · 2.46 KB
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
79
80
81
82
83
84
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/scripts/setup_lib.sh"
print_usage() {
cat <<'EOF'
Usage: ./macsetup.sh
Applies the macOS defaults this repo keeps intentionally:
- faster key repeat and shorter delay
- faster window and Mission Control animations
- full keyboard navigation with Tab
- higher Bluetooth audio bitpool
- trackpad and mouse speed
- Finder hidden files, extensions, and status bar
- clear Dock icons, set Dock size, enable auto-hide, remove hide delay
EOF
}
require_macos() {
if [[ "$OSTYPE" != darwin* ]]; then
printf 'macsetup.sh only supports macOS.\n' >&2
exit 1
fi
}
apply_defaults() {
log_step "Configuring keyboard repeat rate and delay"
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10
log_step "Configuring keyboard navigation"
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
log_step "Configuring animation speed"
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
defaults write com.apple.dock expose-animation-duration -float 0.1
log_step "Improving Bluetooth audio bitrate"
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
log_step "Configuring trackpad and mouse speed"
defaults write -g com.apple.trackpad.scaling -float 2
defaults write -g com.apple.mouse.scaling -float 2.5
log_step "Configuring Finder"
defaults write com.apple.finder AppleShowAllFiles -bool true
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write com.apple.finder ShowStatusBar -bool true
log_step "Configuring Dock"
defaults write com.apple.dock persistent-apps -array
defaults write com.apple.dock persistent-others -array
defaults write com.apple.dock tilesize -int 36
defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
}
restart_services() {
log_step "Restarting affected services"
for app in cfprefsd Dock Finder SystemUIServer; do
killall "$app" >/dev/null 2>&1 || true
done
}
main() {
if [[ "${1:-}" == "--help" ]]; then
print_usage
exit 0
fi
require_macos
apply_defaults
restart_services
printf 'macOS defaults updated. Some changes may still require logout or restart.\n'
}
main "$@"