-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdefaults.sh
More file actions
executable file
·79 lines (63 loc) · 3.74 KB
/
defaults.sh
File metadata and controls
executable file
·79 lines (63 loc) · 3.74 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
#!/usr/bin/env bash
# defaults.sh — opinionated macOS system tweaks. Idempotent.
# Some changes require app restart or logout to take effect.
set -eo pipefail
[[ "$OSTYPE" != darwin* ]] && exit 0
log() { printf "\033[1;34m==>\033[0m %s\n" "$*"; }
# Quit System Settings so it doesn't override our writes.
osascript -e 'tell application "System Settings" to quit' 2>/dev/null || true
log "Finder: show extensions, hidden files, path/status bar, list view"
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write com.apple.finder AppleShowAllFiles -bool true
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder ShowStatusBar -bool true
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
defaults write com.apple.finder _FXSortFoldersFirst -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
log "Finder: disable .DS_Store on network/USB volumes"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
log "Screenshots: ~/Pictures/Screenshots, PNG, no shadow"
mkdir -p ~/Pictures/Screenshots
defaults write com.apple.screencapture location -string "$HOME/Pictures/Screenshots"
defaults write com.apple.screencapture type -string "png"
defaults write com.apple.screencapture disable-shadow -bool true
log "Keyboard: faster repeat, no press-and-hold, full keyboard nav"
defaults write NSGlobalDomain InitialKeyRepeat -int 15
defaults write NSGlobalDomain KeyRepeat -int 2
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
log "Disable autocorrect / smart quotes / smart dashes / period substitution"
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
log "Dock: smaller, no recents, no bouncing, scale minimize"
defaults write com.apple.dock tilesize -int 36
defaults write com.apple.dock show-recents -bool false
defaults write com.apple.dock no-bouncing -bool true
defaults write com.apple.dock mineffect -string "scale"
log "Mission Control: don't auto-rearrange spaces"
defaults write com.apple.dock mru-spaces -bool false
log "Trackpad: tap to click"
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults write com.apple.AppleMultitouchTrackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
log "Safari: full URL, dev menu, do-not-track"
defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool true
defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true
log "TextEdit: plain text default, UTF-8"
defaults write com.apple.TextEdit RichText -int 0
defaults write com.apple.TextEdit PlainTextEncoding -int 4
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
log "Restart affected apps (Finder, Dock, SystemUIServer)"
for app in Finder Dock SystemUIServer; do
killall "$app" >/dev/null 2>&1 || true
done
log "Done. Some changes may require logout to fully apply."