macOS 个性化设置,通过命令行开启 macOS 的隐藏功能,下面的脚本是我的个性化设置。

sudo macos-awesome-settings.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash

# ------------------- Dock -----------------------

## Add a Stack with Recent Applications and Recent Documents
defaults write com.apple.dock persistent-others -array-add \
'<dict>
<key>tile-data</key>
<dict>
<key>list-type</key>
<integer>2</integer>
<key>viewas</key>
<integer>3</integer>
</dict>
<key>tile-type</key>
<string>recents-tile</string>
</dict>' \
'<dict>
<key>tile-data</key>
<dict>
<key>list-type</key>
<integer>1</integer>
<key>viewas</key>
<integer>3</integer>
</dict>
<key>tile-type</key>
<string>recents-tile</string>
</dict>'

## Resize
defaults write com.apple.dock tilesize -int 30

## Scroll Gestures. Use your touchpad or mouse scroll wheel to interact with Dock items. Allows you to use an upward scrolling gesture to open stacks. Using the same gesture on applications that are running invokes Exposé/Mission Control.
defaults write com.apple.dock scroll-to-open -bool true

## Enable Dock Autohide
defaults write com.apple.dock autohide -bool true

## Set Auto Show/Hide Delay. The float number defines the show/hide delay in ms.
defaults write com.apple.dock autohide-time-modifier -float 0.4 && \
defaults write com.apple.dock autohide-delay -float 0

## Show Hidden App Icons
defaults write com.apple.dock showhidden -bool true


# -------------------------- Finder -----------------------------

## Show All File Extensions
defaults write -g AppleShowAllExtensions -bool true

## Show Full Path in Finder Title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true

## Unhide User Library Folder
chflags nohidden ~/Library

## Increase Number of Recent Places
defaults write -g NSNavRecentPlacesLimit -int 30

## Path Bar
defaults write com.apple.finder ShowPathbar -bool true

## Set Current Folder as Default Search Scope
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"

## Set Default Finder Location to Home Folder
defaults write com.apple.finder NewWindowTarget -string "PfLo" && \
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}"


# -------------------------- Fonts ------------------------------

## Get SF Mono Fonts. From Sierra onward
cp -v /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/SFMono-* ~/Library/Fonts


# -------------------------------- Bluetooth ---------------------------

## Enable AAC and AptX
defaults write bluetoothaudiod "Enable AptX codec" -bool true
defaults write bluetoothaudiod "Enable AAC codec" -bool true


# -------------------------------- Keyboard --------------------------

## Key Repeat Rate. Sets a very fast repeat rate, adjust to taste.
defaults write -g KeyRepeat -int 0.02


# ------------------------------- Launchpad --------------------------

## 9 x 7
defaults write com.apple.dock springboard-columns -int 9 && \
defaults write com.apple.dock springboard-rows -int 7 && \
defaults write com.apple.dock ResetLaunchPad -bool TRUE

# ---------------------------------------------------------------

killall Dock
killall Finder

相关链接,更多设置

awesome-macos-command-line
少数派
iDB
https://stackoverflow.com/questions/13740337/modifying-a-plist-from-command-line-on-mac-using-defaults