defaults
defaults read
defaults read com.apple.finder
defaults read com.apple.finder DesktopViewSettings
{
GroupBy = None;
IconViewSettings = {
arrangeBy = none;
backgroundColorBlue = 1;
backgroundColorGreen = 1;
backgroundColorRed = 1;
backgroundType = 0;
gridOffsetX = 0;
gridOffsetY = 0;
gridSpacing = 54;
iconSize = 96;
labelOnBottom = 1;
showIconPreview = 1;
showItemInfo = 0;
textSize = 12;
viewOptionsVersion = 1;
};
}
defaults read-type com.apple.finder DesktopViewSettings
# Type is dictionary
# defaults write com.apple.finder DesktopViewSettings -dict IconViewSettings '{iconSize = 64; gridSpacing = 100; arrangement = "notArranged"; backgroundColor = "0.5 0.5 0.5";}'
I18n
defaults write com.apple.Maps AppleLanguages '(zh-CN)'
defaults delete com.apple.Maps AppleLanguages
macOS 允许在运行应用程序时向其传递特定参数,其中,-AppleLanguages
参数就是用来控制应用程序的语言的。
要知道一个应用都支持哪些界面语言,可以在 Finder 中找到该应用,点击右键选择显示包内容,然后查看 /Contents/Resources 目录下以 .lproj 结尾的语言文件目录;.lproj 之前的部分就是各语言对应的地区代码
# 以简体中文界面启动
open -a /System/Applications/Maps.app --args -AppleLanguages '(zh-CN)'
# 以英文界面启动
open -a /Applications/Safari.app --args -AppleLanguages '(en)'
open -na "Chrome" --args --incognito
BundleIdentifier
mdls -name kMDItemCFBundleIdentifier /Applications/Safari.app
# kMDItemCFBundleIdentifier = "com.apple.Safari"
osascript -e 'id of app "Finder" '
# com.apple.finder
Ref: