背景:
某些应用在MacOS 暗黑模式下无法很好的支持,需要为该应用单独关闭暗黑主题
解决方案:
- 首先进入你程序的目录运行终端,查询应用捆绑的id
osascript -e 'id of app "<App-Name>"'
- 为应用写入属性AquaSystemAppearance,将以上返回结果作为参数传入以下的
<Bundle-Identifier>
defaults write <Bundle-Identifier> NSRequiresAquaSystemAppearance -bool yes
- 重置以上所设属性方法
defaults delete <Bundle-Identifier> NSRequiresAquaSystemAppearance -bool yes
例子:
为苹果Books应用排除暗黑模式