阻止Anki“自黑”的正确姿势

catalina一黑到底,连地头蛇微信都不得不服软,但真的好吗?

只能说,几家欢喜几家忧。对anki for mac版本 2.1.20 (47a1bf8b)而言,黑暗模式就是个迷。程序设置里尽管有dark mode选项,但实际上形同摆设。无论勾选与否,anki皆会随着系统的自动切换而切换。夜晚看anki,黑乎乎一坨,好不烦恼。

修改info.plst =>无效

有人说改info.plist可拯救1,于是我在系统应用程序里找到Anki.app,右键打开Contents目录,用轻量级编辑器打开Info.plist文件后,找到如下两个参数:

	<key>NSRequiresAquaSystemAppearance</key>
	<false/>
	<key>NSSupportsAutomaticGraphicsSwitching</key>
	<true/>

修改为:

	<key>NSRequiresAquaSystemAppearance</key>
	<true/>
	<key>NSSupportsAutomaticGraphicsSwitching</key>
	<false/>

重启,无效!

defaults write =>无效

又有技术博说,Mojave时代只需一句命令行可破2,于是我想方设法去寻得anki的Bundle Identifier

$ osascript -e 'id of app "Anki"'
net.ankiweb.dtop

然后键入:

$ defaults write net.ankiweb.dtop NSRequiresAquaSystemAppearance -bool Yes

注:如要关闭强制该模式,需输入另一行命令:

$ defaults delete  net.ankiweb.dtop  NSRequiresAquaSystemAppearance

重启,依然无效!!

官方答案

最终,Anki的作者Damien Elmes给出了最正确且最简单的官方答案:重新下载

When using macOS in dark mode, recent Anki versions will automatically switch to night mode. If you want to force Anki to use light mode while using the rest of your system in dark mode, please install Anki 2.1.21beta3 or later , and install the -alternate version rather than the -standard one.3


  1. MacPro为知笔记关闭黑暗模式 ↩︎

  2. How to Turn Off Dark Mode for Specific Apps in macOS Mojave ↩︎

  3. Anki manual:Preferences ↩︎