defaults
https://gyazo.com/12457840813c7759f189295643b8ab4a
macOS applications and other programs use the defaults system to record user preferences and other information to be maintained when the application isn't running (font for new documents, or the position of an Info panel). Much of this information is accessible through an application's Preferences panel but sometimes they're hidden. User defaults belong to domains, which typically correspon d to individual applications. Applications, system services, and other programs have their own domains, they also share a domain named NSGlobalDomain. If a default isn't specified in the application's domain, it may be specified in NSGlobalDomain.
Each domain has a dictionary of keys and values representing its defaults; e.g. "Default Font" = "Helvetica". Keys are strings, values can be complex data structures comprising arrays, dictionaries, strings, and binary data. They're stored as XML Property List.
The defaults command line interface is a way to interact with these values.
~/Library/Preferences/com.apple.dock.plist に設定されているものを書き換える CLI
コマンドの調べ方
code: (bash)
default read > before.json
# システム設定変更する
default read > after.json
diff before.json after.json
本ページにある defaults.sh の適用コマンド
code: (bash)
code: defaults.sh
###
### Finder
###
# .DS_Store をネットワークファイルに作成しない
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# 拡張子を表示する
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# 隠しファイルを表示する
defaults write com.apple.Finder AppleShowAllFiles -bool true
# 下部にパスバーを表示する
defaults write com.apple.finder ShowPathbar -bool true
###
### Keyboard
###
# キーリピートの速度(押し続けたときの反復間隔)を高速に設定する
defaults write NSGlobalDomain KeyRepeat -int 3
# キーリピート開始までの待機時間を短く設定する
defaults write NSGlobalDomain InitialKeyRepeat -int 20
# 入力時の自動スペル修正を無効化する
defaults write NSAutomaticSpellingCorrectionEnabled -bool false
# Web入力エリアでの自動スペル修正を無効化する
defaults write WebAutomaticSpellingCorrectionEnabled -bool false
# 自動大文字変換(文頭などの大文字化)を無効化する
defaults write NSAutomaticCapitalizationEnabled -bool false
# ダブルスペースでピリオド変換する機能を無効化する
defaults write NSAutomaticPeriodSubstitutionEnabled -bool false
# 入力時のダッシュへの自動変換を無効化する
defaults write NSAutomaticDashSubstitutionEnabled -bool false
# 入力時のクォート(引用符)の自動変換を無効化する
defaults write NSAutomaticQuoteSubstitutionEnabled -bool false
###
### Dock
###
# Dockのアイコンサイズを1〜128の範囲で指定
defaults write com.apple.dock tilesize -int 48
# ウィンドウをしまう時のアニメーションをシンプルに
defaults write com.apple.dock mineffect -string scale
# 起動中のアプリのアニメーション無効化
defaults write com.apple.dock launchanim -bool false
# Dockの自動表示/非表示機能を有効化
defaults write com.apple.dock autohide -bool true
# Dock表示速度 最速化
defaults write com.apple.dock autohide-delay -int 0
# Dock表示アニメーション速度 最速化
defaults write com.apple.dock autohide-time-modifier -int 0
# 拡大を有効
defaults write com.apple.dock magnification -bool true
# 拡大サイズ
defaults write com.apple.dock largesize -int 64
### RESTART
killall Dock
###
### Screenshots
###
defaults write com.apple.screencapture location ~/Downloads/
defaults write com.apple.screencapture type png
defaults write com.apple.screencapture show-thumbnail -bool false
defaults write com.apple.screencapture disable-shadow -bool true
###
### Restart Finder,SystemUIServer
###
killall Finder
killall SystemUIServer
Reference