在 MacOS 上焦点跟随鼠标

Focus Follows Mouse on MacOS

问题:如何在 MacOS 上为所有 windows/应用程序实现 焦点跟随鼠标?

CONTEXT:诸如“defaults write com.apple.terminal FocusFollowsMo​​use -string true”之类的终端命令仅对终端 windows.

实现所需的行为

相似POST:Implement "Mouse Follows Focus" on MacOS

这是我在 Mojave 和 Big Sur 上成功使用的 M1 Mac:

默认写入com.apple.terminal FocusFollowsMo​​use -string true

这是答案:https://github.com/sbmpost/AutoRaise 完美运行

使用区分大小写文件系统的用户注意(像我们中的许多人一样)命令应该是 默认写入 com.apple.Terminal FocusFollowsMo​​use -string YES 注意终端中的“T”。否则终端将忽略该设置。同样在蒙特雷,我使用 Xcode 编辑 plist,发现 FocusFollowsMo​​use 已经存在,但它是布尔值而不是字符串。该条目必须具有值为 YES 的字符串类型才能正常工作。

完成上述更改后,终端可以在我带有 Monterey 的新 M1 MacBook Pro 上使用 FocusFollowsMo​​use。

Yabai Window Manager 还具有自动对焦功能,以及 window 边框和其他功能。对于这个特定的用例来说,这可能有点矫枉过正,但对于寻找此功能的人来说,因为他们来自另一个 TWM,这可能会有所帮助。