forked from driesvints/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.macos
495 lines (365 loc) · 21.7 KB
/
.macos
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
#!/usr/bin/env bash
# 시스템 환경설정 패널 종료
osascript -e 'tell application "System Preferences" to quit'
# 관리자 비밀번호 요청
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
###############################################################################
# General UI/UX #
###############################################################################
# computer_name="taking-macbook"
# 입력받은 이름으로 컴퓨터 이름 설정 (System Preferences → Sharing)
# sudo scutil --set ComputerName "$computer_name"
# sudo scutil --set HostName "$computer_name"
# sudo scutil --set LocalHostName "$computer_name"
# sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$computer_name"
# 부팅 시 사운드 효과 비활성화
sudo nvram SystemAudioVolume=" "
# 창 크기 조정 속도 향상 (Default: 0.2)
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# 기본 파일 저장 위치 (Default: true)
# true 설정 시, icloud 기본
# false 설정 시, 디스크 기본
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# 인쇄 작업이 완료되면 프린터 앱 자동 종료
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
# "이 애플리케이션을 열겠습니까?" 대화 상자 표시 (Default: true)
defaults write com.apple.LaunchServices LSQuarantine -bool false
# '연결 프로그램' 메뉴에서 중복 항목 제거
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
# 충돌 리포트 비활성화
defaults write com.apple.CrashReporter DialogType -string "none"
# Set Help Viewer windows to non-floating mode
defaults write com.apple.helpviewer DevMode -bool true
# Disable smart dashes as they’re annoying when typing code
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
###############################################################################
# Trackpad, mouse, keyboard, Bluetooth accessories, and input #
###############################################################################
# Trackpad: enable tap to click for this user and for the login screen
# defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
# defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# Trackpad: map bottom right corner to right-click
# defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
# defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true
# defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1
# defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true
# Disable “natural” (Lion-style) scrolling
# defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
# Increase sound quality for Bluetooth headphones/headsets
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Use scroll gesture with the Ctrl (^) modifier key to zoom
# defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
# defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
# Follow the keyboard focus while zoomed in
# defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
# 키 반복을 위해 키에 대한 길게 누르기 비활성화
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# 빠른 키보드 반복 속도 설정
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10
# 언어 및 텍스트 형식 설정
defaults write NSGlobalDomain AppleLanguages -array "ko" "en"
defaults write NSGlobalDomain AppleLocale -string "ko_KR@currency=WON"
defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters"
defaults write NSGlobalDomain AppleMetricUnits -bool true
# 표준 시간대 설정
sudo systemsetup -settimezone "Asia/Seoul" > /dev/null
# Stop iTunes from responding to the keyboard media keys
#launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist 2> /dev/null
###############################################################################
# Energy saving #
###############################################################################
# 잠자기 깨우기
sudo pmset -a lidwake 1
# 전원이 차단된 후 자동 재시작
sudo pmset -a autorestart 1
# 컴퓨터가 멈춘 경우 자동으로 다시 시작
sudo systemsetup -setrestartfreeze on
# 디스플레이 절전 시간을 10분으로 설정 (배터리 사용 시)
sudo pmset -a displaysleep 10
# 시스템 절전 시간을 15분으로 설정 (배터리 사용 시)
sudo pmset -b sleep 15
# 충전 중 기기 절전 모드 비활성화
sudo pmset -c sleep 0
# 대기 시간 지연을 24시간으로 설정(기본값은 1시간)
sudo pmset -a standbydelay 86400
# 컴퓨터 절전 모드로 전환하지 않기
sudo systemsetup -setcomputersleep Off > /dev/null
# 최대 절전 모드
# 0: 최대 절전 모드 비활성화(절전 모드 진입 속도 향상)
# 3: 정전 시에도 시스템 상태를 복원할 수 있도록 RAM을 디스크에 복사
sudo pmset -a hibernatemode 0
###############################################################################
# Screen #
###############################################################################
# Re-enable subpixel antialiasing
defaults write -g CGFontRenderingFontSmoothingDisabled -bool FALSE
# 절전모드 & 화면 보호기 시작 시, 비밀번호 요구
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
# Apple 이외의 LCD에서 서브픽셀 글꼴 렌더링 활성화
# Reference: https://github.com/kevinSuttle/macOS-Defaults/issues/17#issuecomment-266633501
defaults write NSGlobalDomain AppleFontSmoothing -int 1
# Enable HiDPI display modes (requires restart)
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
###############################################################################
# Finder #
# ref: https://macos-defaults.com/finder #
###############################################################################
# 커멘드 + Q를 통한 강제 종료 (Default: false)
defaults write com.apple.finder QuitMenuItem -bool true
# 파일 확장자 표시 (Default: false)
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# 숨김 파일 표시 (Default: false)
defaults write com.apple.finder AppleShowAllFiles -bool false
# 경로 표시 (Default: false)
defaults write com.apple.finder ShowPathbar -bool true
# 기본 뷰 설정 (Default: icnv)
# 4개의 선택지 : `icnv`, `clmv`, `glyv`, 'Nlsv'
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# 폴더 정렬 설정 (Default: false)
defaults write com.apple.finder _FXSortFoldersFirst -bool true
# 기본 검색 설정 (Default: SCev)
# 4개의 선택지 : `SCev`, `SCsp`, `SCcf`
# SCcv(Search the current folder), Scsp(Use the previous search scope), Scef(Search this Mac)
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# 쓰레기통 제거 설정 (Default: false)
# true 설정 시, 30일 후 자동 쓰레기통 비우기
defaults write com.apple.finder "FXRemoveOldTrashItems" -bool false
# 파일 확장자 변경 경고 설정 (Default: false)
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# 사이드바 아이콘 사이즈 (Default: 2)
# 1: Small, 2: Medium, 3: Large
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2
# 정렬할 때 폴더를 맨 위에 유지 (Default: false)
defaults write com.apple.finder "_FXSortFoldersFirstOnDesktop" -bool false
# 바탕화면에 하드디스크 표시 (Default: false)
defaults write com.apple.finder "ShowHardDrivesOnDesktop" -bool false
# 바탕화면에 외장하드 표시 (Default: true)
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
# 바탕화면에 이동식 미디어 표시 (Default: true)
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# 바탕화면에 연결된 서버 표시 (Default: false)
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
# Finder: disable window animations and Get Info animations
defaults write com.apple.finder DisableAllAnimations -bool true
# 파인더 시작 시, 기본 경로 설정
# pfHm - Home 디렉토리
# pfDe - Desktop 디렉토리
# pfLo - 최근 사용한 디렉토리
defaults write com.apple.finder NewWindowTarget -string "PfHm"
# defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Desktop/"
# 네트워크 또는 USB 볼륨에 .DS_Store 생성 비활성화
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
# 디스크 이미지 검증 비활성화
# defaults write com.apple.frameworks.diskimages skip-verify -bool true
# defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
# defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
# 볼륨이 마운트 시, 자동으로 새로운 파인더 창 띄우기
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
# Show item info near icons on the desktop and in other icon views
# /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
# /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
# Show item info to the right of the icons on the desktop
# /usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist
# Enable snap-to-grid for icons on the desktop and in other icon views
/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
# Increase grid spacing for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
# Increase the size of icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
# 휴기통 비우기 경고 알람 비활성화 (Default: true)
defaults write com.apple.finder WarnOnEmptyTrash -bool false
# AirDrop 활성화
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# 라이브러리 폴더 표시
chflags nohidden ~/Library
# 볼륨 폴더 표시
# sudo chflags nohidden /Volumes
# Finder 내 Dropbox 아이콘 제거
# file=/Applications/Dropbox.app/Contents/Resources/emblem-dropbox-uptodate.icns
# [ -e "${file}" ] && mv -f "${file}" "${file}.bak"
# Expand the following File Info panes:
# “General”, “Open with”, and “Sharing & Permissions”
defaults write com.apple.finder FXInfoPanesExpanded -dict \
General -bool true \
OpenWith -bool true \
Privileges -bool true
###############################################################################
# ScreenShot #
# reference. https://macos-defaults.com/screenshots/disable-shadow.html #
###############################################################################
# ScreenShot 그림자 제거 (Default: false)
defaults write com.apple.screencapture "disable-shadow" -bool false
# ScreenShot 날짜 표시 (Default: false)
defaults write com.apple.screencapture "include-date" -bool false
# Screenshot 기본 저장 위치 (Default: ~/Desktop)
defaults write com.apple.screencapture "location" -string "~/Desktop"
# Enable highlight hover effect for the grid view of a stack (Dock)
defaults write com.apple.dock mouse-over-hilite-stack -bool true
# Screenshot 확장자 (Default: png)
defaults write com.apple.screencapture "type" -string "png"
###############################################################################
# Dock, Dashboard, and hot corners #
# reference. https://macos-defaults.com/dock #
###############################################################################
# Dock 위치 (Default: Bottom)
defaults write com.apple.dock "orientation" -string "bottom"
# Dock 사이즈 (Default: 48)
defaults write com.apple.dock "tilesize" -int "48"
# Dock 숨기기 (Default: false)
defaults write com.apple.dock "autohide" -bool true
# 자동 숨기기 딜레이 설정 (Default: 0.2)
defaults write com.apple.dock autohide-delay -float 0
# 자동 숨기기 애니메이션 설정 (Default: 0.5)
defaults write com.apple.dock autohide-time-modifier -float 0
# Dock 내 최근 앱 표시 (Default: true)
defaults write com.apple.dock show-recents -bool false
# 최소화/최대화 효과 (Default: genie)
defaults write com.apple.dock mineffect -string "scale"
# Docker 내 실행 중인 앱만 표시 (Default: false)
defaults write com.apple.dock static-only -bool true
# Dock 아이콘을 위로 스크롤하면 열려 있는 모든 창이 표시 (Default: false)
defaults write com.apple.dock "scroll-to-open" -bool true
# Minimize windows into their application’s icon
defaults write com.apple.dock minimize-to-application -bool true
# Enable spring loading for all Dock items
# defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
# Show indicator lights for open applications in the Dock
# defaults write com.apple.dock show-process-indicators -bool true
# Dock에서 모든(기본값) 앱 아이콘 지우기
# 이 기능은 새 Mac을 설정할 때나 Dock을 사용하여 앱을 실행하지 않는 경우에만 유용합니다.
defaults write com.apple.dock persistent-apps -array
# Dock 애플리케이션 끄기
defaults write com.apple.dock launchanim -bool false
# 미션 컨트롤 애니메이션 속도 향상
# defaults write com.apple.dock expose-animation-duration -float 0.1
# 미션 컨트롤에서 애플리케이션별로 창을 그룹화하지 않기
# (i.e. use the old Exposé behavior instead)
# defaults write com.apple.dock expose-group-by-app -bool false
# 대시보드 비활성화
defaults write com.apple.dashboard mcx-disabled -bool true
# Don’t show Dashboard as a Space
defaults write com.apple.dock dashboard-in-overlay -bool true
# 가장 최근 사용을 기준으로 스페이스를 자동으로 재정렬 (Default: true)
defaults write com.apple.dock mru-spaces -bool false
# 앱 그룹화 (Default: false)
defaults write com.apple.dock "expose-group-apps" -bool true
# Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true
# Disable the Launchpad gesture (pinch with thumb and three fingers)
#defaults write com.apple.dock showLaunchpadGestureEnabled -int 0
# Add a spacer to the left side of the Dock (where the applications are)
#defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
# Add a spacer to the right side of the Dock (where the Trash is)
#defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'
# Hot corners
# Possible values:
# 0: no-op
# 2: Mission Control
# 3: Show application windows
# 4: Desktop
# 5: Start screen saver
# 6: Disable screen saver
# 7: Dashboard
# 10: Put display to sleep
# 11: Launchpad
# 12: Notification Center
# 13: Lock Screen
# Top left screen corner → Mission Control
# defaults write com.apple.dock wvous-tl-corner -int 2
# defaults write com.apple.dock wvous-tl-modifier -int 0
# Top right screen corner → Desktop
defaults write com.apple.dock wvous-tr-corner -int 10
defaults write com.apple.dock wvous-tr-modifier -int 0
# Bottom left screen corner → Start screen saver
# defaults write com.apple.dock wvous-bl-corner -int 5
# defaults write com.apple.dock wvous-bl-modifier -int 0
###############################################################################
# Terminal & iTerm 2 #
###############################################################################
# Terminal.app UTF-8 사용
defaults write com.apple.terminal StringEncodings -array 4
# iTerm2 종료 시 알람 표시 (Default: true)
defaults write com.googlecode.iterm2 PromptOnQuit -bool false
###############################################################################
# Time Machine #
###############################################################################
# 새 하드 디스크 백업 볼륨 사용 안내 비활성화 (Default: false)
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
###############################################################################
# Activity Monitor #
###############################################################################
# Show the main window when launching Activity Monitor
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
# Visualize CPU usage in the Activity Monitor Dock icon
defaults write com.apple.ActivityMonitor IconType -int 5
# Show all processes in Activity Monitor
defaults write com.apple.ActivityMonitor ShowCategory -int 0
# Sort Activity Monitor results by CPU usage
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
defaults write com.apple.ActivityMonitor SortDirection -int 0
###############################################################################
# Mac App Store #
###############################################################################
# Mac App Store에서 WebKit 개발자 도구 활성화하기
defaults write com.apple.appstore WebKitDeveloperExtras -bool true
# 자동 업데이트 확인 사용 설정
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
# 일주일에 한 번이 아닌 매일 소프트웨어 업데이트 확인
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# 백그라운드에서 새로 사용 가능한 업데이트 다운로드
defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1
# 시스템 데이터 파일 및 보안 업데이트 설치
defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1
# 앱 자동 업데이트 켜기
defaults write com.apple.commerce AutoUpdate -bool true
###############################################################################
# Photos #
###############################################################################
# 기기 연결 시 자동으로 Photos 열기 방지 (Default: false)
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
###############################################################################
# Kill affected applications #
###############################################################################
for app in "Activity Monitor" \
"Address Book" \
"Calendar" \
"cfprefsd" \
"Contacts" \
"Dock" \
"Finder" \
"Mail" \
"Messages" \
"Photos" \
"Safari" \
"SystemUIServer" \
"Terminal" \
"iCal"; do
killall "${app}" &> /dev/null
done
echo "완료되었습니다. 변경사항 중 일부는 로그아웃 또는 시스템 재시작 시 적용됩니다."